emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IELM prompt


From: Luc Teirlinck
Subject: Re: IELM prompt
Date: Sun, 25 Apr 2004 14:35:45 -0500 (CDT)

I now believe there is a problem with your latest patch to ielm.el.
If one is working in an *ielm* buffer, then switch to other buffers,
then do M-x ielm to return to the *ielm* buffer, one does usually
_not_ want point to move to the end, without even having a marker set
to go back.  You can do RET on any prompt.  In the case of reenabling
ielm after it was interrupted, the probability of the user wanting to
go to the end is bigger, but not equal to 1.

The behavior _before_ your patch did not make sense either.  If one
did M-x ielm on an interrupted process, one went to the end if and
only if the ielm buffer is not current at the time one does M-x ielm.
But it is exactly when the ielm buffer is _not_ current that one
might want to see where point used to be after switching to the *ielm*
buffer.  No mark is set, so that information is irretrievable lost.

I believe that if one switches back to an active ielm process, point
should stay where it is.  For an interrupted process, two possible
solutions are to always stay, or to always move to the end, but
setting the mark, so the user can easily go back.  The patch below
implements the latter.  I could commit if there are no objections.

===File ~/ielm.el-diff======================================
*** ielm.el     25 Apr 2004 12:14:17 -0500      1.39
--- ielm.el     25 Apr 2004 14:02:34 -0500      
***************
*** 547,559 ****
    "Interactively evaluate Emacs Lisp expressions.
  Switches to the buffer `*ielm*', or creates it if it does not exist."
    (interactive)
!   (if (comint-check-proc "*ielm*")
!       nil
!     (save-excursion
!       (set-buffer (get-buffer-create "*ielm*"))
!       (inferior-emacs-lisp-mode)))
!   (pop-to-buffer "*ielm*")
!   (goto-char (point-max)))
  
  (provide 'ielm)
  
--- 547,559 ----
    "Interactively evaluate Emacs Lisp expressions.
  Switches to the buffer `*ielm*', or creates it if it does not exist."
    (interactive)
!   (let (old-point)
!     (unless (comint-check-proc "*ielm*")
!       (with-current-buffer (get-buffer-create "*ielm*")
!       (unless (eq (buffer-size) 0) (setq old-point (point)))
!       (inferior-emacs-lisp-mode)))
!     (pop-to-buffer "*ielm*")
!     (when old-point (push-mark old-point))))
  
  (provide 'ielm)
  
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]