From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: IELM prompt Date: Sun, 25 Apr 2004 02:40:18 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20040425021531.5172.LEKTU@mi.madritel.es> References: <20040425012954.516F.LEKTU@mi.madritel.es> <200404242351.i3ONphr17120@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1082853758 22816 80.91.224.253 (25 Apr 2004 00:42:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 25 Apr 2004 00:42:38 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Apr 25 02:42:27 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BHXj1-0000Pz-00 for ; Sun, 25 Apr 2004 02:42:27 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BHXj1-0005gc-00 for ; Sun, 25 Apr 2004 02:42:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHXiv-0007FD-GZ for emacs-devel@quimby.gnus.org; Sat, 24 Apr 2004 20:42:21 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BHXi4-0006mH-Vd for emacs-devel@gnu.org; Sat, 24 Apr 2004 20:41:28 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BHXhG-00059n-4c for emacs-devel@gnu.org; Sat, 24 Apr 2004 20:41:12 -0400 Original-Received: from [62.81.186.17] (helo=smtp07.retemail.es) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHXgw-0004ai-S6 for emacs-devel@gnu.org; Sat, 24 Apr 2004 20:40:19 -0400 Original-Received: from [127.0.0.1] ([213.37.34.45]) by smtp07.retemail.es (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20040425004023.LFBA26640.smtp07.retemail.es@[127.0.0.1]> for ; Sun, 25 Apr 2004 02:40:23 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: <200404242351.i3ONphr17120@raven.dms.auburn.edu> X-Mailer: Becky! ver. 2.09.01 [en] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22110 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22110 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)