From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: comint read-only prompt Date: Tue, 20 Aug 2002 12:14:29 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200208201614.g7KGETp18927@rum.cs.yale.edu> References: <200208191540.g7JFemV13663@rum.cs.yale.edu> <1029772679.16562.13.camel@turtle.as.arizona.edu> <20020819234511.GD3763@gnu.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1029860134 16971 127.0.0.1 (20 Aug 2002 16:15:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 20 Aug 2002 16:15:34 +0000 (UTC) Cc: JD Smith , Stefan Monnier , Miles Bader , "Marshall, Simon" , "'Emacs Developers'" Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17hBfJ-0004Pa-00 for ; Tue, 20 Aug 2002 18:15:33 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17hC7H-0007uj-00 for ; Tue, 20 Aug 2002 18:44:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17hBgN-0006E8-00; Tue, 20 Aug 2002 12:16:39 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17hBeP-0006Ch-00 for emacs-devel@gnu.org; Tue, 20 Aug 2002 12:14:37 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17hBeL-0006C9-00 for emacs-devel@gnu.org; Tue, 20 Aug 2002 12:14:35 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17hBeL-0006C3-00; Tue, 20 Aug 2002 12:14:33 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g7KGETp18927; Tue, 20 Aug 2002 12:14:29 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Miles Bader Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6677 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6677 > On Mon, Aug 19, 2002 at 08:57:59AM -0700, JD Smith wrote: > > Another option I tried is adding, at the time of overlay move, a > > read-only text property (and don't forget rear-nonsticky). I reasoned > > that this is perfectly acceptable given the new use of text properties > > in CVS comint. I didn't like the error message as much. > > Given how often this sort of complaint turns up (that a read-only property is > a good solution except for the error message), how about this idea: If a > signalling an error due to a read-only property, if the property's value is a > string, use that as the error message rather than the default. I can only agree given that I've thought about the same thing a few months back and even did some attempt at coding; see patch below. The print_error_message needs to be updated as well, but I didn't go that far. Stefan Index: textprop.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/textprop.c,v retrieving revision 1.132 diff -u -r1.132 textprop.c --- textprop.c 16 Jul 2002 17:37:14 -0000 1.132 +++ textprop.c 20 Aug 2002 16:10:19 -0000 @@ -83,9 +83,10 @@ to capture that error in GDB by putting a breakpoint on it. */ static void -text_read_only () +text_read_only (propval) + Lisp_Object propval; { - Fsignal (Qtext_read_only, Qnil); + Fsignal (Qtext_read_only, STRINGP (propval) ? Fcons (propval, Qnil) : Qnil); } @@ -2051,7 +2052,7 @@ if (TMEM (Qread_only, tem) || (NILP (Fplist_get (i->plist, Qread_only)) && TMEM (Qcategory, tem))) - text_read_only (); + text_read_only (after); } } @@ -2071,7 +2072,7 @@ if (! TMEM (Qread_only, tem) && (! NILP (Fplist_get (prev->plist,Qread_only)) || ! TMEM (Qcategory, tem))) - text_read_only (); + text_read_only (before); } } } @@ -2090,13 +2091,13 @@ if (TMEM (Qread_only, tem) || (NILP (Fplist_get (i->plist, Qread_only)) && TMEM (Qcategory, tem))) - text_read_only (); + text_read_only (after); tem = textget (prev->plist, Qrear_nonsticky); if (! TMEM (Qread_only, tem) && (! NILP (Fplist_get (prev->plist, Qread_only)) || ! TMEM (Qcategory, tem))) - text_read_only (); + text_read_only (after); } } } @@ -2118,7 +2119,7 @@ do { if (! INTERVAL_WRITABLE_P (i)) - text_read_only (); + text_read_only (textget (i->plist, Qread_only)); if (!inhibit_modification_hooks) {