GNU bug report logs - #76585
ielm clobbers history on C-c C-c, C-d

Previous Next

Package: emacs;

Reported by: Daniel Colascione <dancol <at> dancol.org>

Date: Wed, 26 Feb 2025 12:46:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Daniel Colascione <dancol <at> dancol.org>
Subject: bug#76585: closed (Re: bug#76585: ielm clobbers history on C-c
 C-c, C-d)
Date: Sat, 01 Mar 2025 08:29:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#76585: ielm clobbers history on C-c C-c, C-d

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 76585 <at> debbugs.gnu.org.

-- 
76585: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76585
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 76585-done <at> debbugs.gnu.org
Subject: Re: bug#76585: ielm clobbers history on C-c C-c, C-d
Date: Sat, 01 Mar 2025 10:28:43 +0200
> From: Daniel Colascione <dancol <at> dancol.org>
> Cc: 76585 <at> debbugs.gnu.org
> Date: Fri, 28 Feb 2025 16:27:04 -0500
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Thanks.  Does the below give good results?
> >
> > diff --git a/lisp/ielm.el b/lisp/ielm.el
> > index b3cd02b..c651612 100644
> > --- a/lisp/ielm.el
> > +++ b/lisp/ielm.el
> > @@ -521,6 +521,12 @@ ielm--input-history-writer
> >      (with-current-buffer buf
> >        (comint-write-input-ring))))
> >  
> > +(defun ielm--write-history-on-interrupt (_proc _group)
> > +  "Save the IELM input history when the process is interrupted."
> > +  (funcall (ielm--input-history-writer (current-buffer)))
> > +  ;; Let the rest of the hook functions run as well.
> > +  nil)
> > +
> >  ;;; Major mode
> >  
> >  (define-derived-mode inferior-emacs-lisp-mode comint-mode "IELM"
> > @@ -658,7 +664,9 @@ inferior-emacs-lisp-mode
> >           '(rear-nonsticky t field output inhibit-line-move-field-capture t))))
> >      (comint-output-filter (ielm-process) ielm-prompt-internal)
> >      (set-marker comint-last-input-start (ielm-pm))
> > -    (set-process-filter (get-buffer-process (current-buffer)) 'comint-output-filter)))
> > +    (set-process-filter (get-buffer-process (current-buffer)) 'comint-output-filter)
> > +    (add-hook 'interrupt-process-functions
> > +              #'ielm--write-history-on-interrupt -1 t)))
> >  
> >  (defun ielm-get-old-input nil
> >    ;; Return the previous input surrounding point
> 
> This works. Thanks

Thanks, installed on the master branch, and closing the bug.

[Message part 3 (message/rfc822, inline)]
From: Daniel Colascione <dancol <at> dancol.org>
To: bug-gnu-emacs <at> gnu.org
Subject: ielm clobbers history on C-c C-c, C-d
Date: Wed, 26 Feb 2025 07:44:54 -0500
When the ielm inferior dummy process exits, we don't save its history:
when we next start ielm, we reload its history from the save file,
losing any entries between last history save and the present.



This bug report was last modified 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.