emacs-devel
[Top][All Lists]
Advanced

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

Re: IELM prompt


From: Juanma Barranquero
Subject: Re: IELM prompt
Date: Sun, 25 Apr 2004 02:40:18 +0200

Related to the read-onliness of the IELM prompt:

M-x ielm =>
  * Welcome to IELM ***  Type (describe-mode) for help.
  ELISP> 

C-c C-c  =>
  Process ielm interrupt

M-x ielm =>
  *** Welcome to IELM ***  Type (describe-mode) for help.

with no prompt, and a message: "Text is read-only".

A way to fix it is with the attached patch, which:

  - wraps the insertion of the header on a
    (let ((inhibit-read-only t))
       ...)

  - adds a call to (goto-char (point-max)) at the end of `ielm',
    because, as it stands, `inferior-emacs-lisp-mode' can not change the
    point when invoked from inside the *ielm* buffer (as happens while
    restarting the ielm process).

Personally, I think it'd be better to just do

  (when (= (point-min) (point-max))
    ;; Add a silly header
    (insert ielm-header)
     ...)

and *not* insert the header when restarting the process, just when the
*ielm* buffer is created the first time around.

Opinions?

                                                           /L/e/k/t/u



Index: ielm.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ielm.el,v
retrieving revision 1.38
diff -u -2 -r1.38 ielm.el
--- ielm.el     24 Apr 2004 22:56:34 -0000      1.38
+++ ielm.el     25 Apr 2004 00:32:15 -0000
@@ -519,7 +519,9 @@
     (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))
@@ -551,5 +553,6 @@
       (set-buffer (get-buffer-create "*ielm*"))
       (inferior-emacs-lisp-mode)))
-  (pop-to-buffer "*ielm*"))
+  (pop-to-buffer "*ielm*")
+  (goto-char (point-max)))
 
 (provide 'ielm)





reply via email to

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