changeset 55135:0d9ec2b24429

(inferior-emacs-lisp-mode): Display working buffer on the mode line. Bind `inhibit-read-only' to t before modifying properties of text in the buffer. (ielm): Force point to the end of buffer, even when running ielm from inside itself.
author Juanma Barranquero <lekktu@gmail.com>
date Sun, 25 Apr 2004 17:16:50 +0000
parents 1f59134413ff
children c86269a40112
files lisp/ielm.el
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ielm.el	Sun Apr 25 14:08:02 2004 +0000
+++ b/lisp/ielm.el	Sun Apr 25 17:16:50 2004 +0000
@@ -429,8 +429,8 @@
 `set-buffer', or with \\[ielm-change-working-buffer]), and its value
 is preserved between successive evaluations.  In this way, expressions
 may be evaluated in a different buffer than the *ielm* buffer.
-Display the name of the working buffer with \\[ielm-print-working-buffer],
-or the buffer itself with \\[ielm-display-working-buffer].
+By default, its name is shown on the mode line; you can always display
+it with \\[ielm-print-working-buffer], or the buffer itself with \\[ielm-display-working-buffer].
 
 During evaluations, the values of the variables `*', `**', and `***'
 are the results of the previous, second previous and third previous
@@ -476,6 +476,7 @@
 
   (setq major-mode 'inferior-emacs-lisp-mode)
   (setq mode-name "IELM")
+  (setq mode-line-process '(":%s on " (:eval (buffer-name ielm-working-buffer))))
   (use-local-map ielm-map)
   (set-syntax-table emacs-lisp-mode-syntax-table)
 
@@ -518,9 +519,10 @@
     (insert ielm-header)
     (ielm-set-pm (point-max))
     (unless comint-use-prompt-regexp-instead-of-fields
-      (add-text-properties
-       (point-min) (point-max)
-       '(rear-nonsticky t field output inhibit-line-move-field-capture t)))
+      (let ((inhibit-read-only t))
+        (add-text-properties
+         (point-min) (point-max)
+         '(rear-nonsticky t field output inhibit-line-move-field-capture t))))
     (comint-output-filter (ielm-process) ielm-prompt)
     (set-marker comint-last-input-start (ielm-pm))
     (set-process-filter (get-buffer-process (current-buffer)) 'comint-output-filter))
@@ -550,7 +552,8 @@
     (save-excursion
       (set-buffer (get-buffer-create "*ielm*"))
       (inferior-emacs-lisp-mode)))
-  (pop-to-buffer "*ielm*"))
+  (pop-to-buffer "*ielm*")
+  (goto-char (point-max)))
 
 (provide 'ielm)