From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: Comint read-only-prompt Date: Tue, 07 Jun 2005 13:59:17 -0700 Message-ID: <1118177957.23850.29.camel@turtle.as.arizona.edu> References: <200506071738.j57Hckj19457@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1118177921 14700 80.91.229.2 (7 Jun 2005 20:58:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Jun 2005 20:58:41 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 07 22:58:33 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dfl8g-000079-DV for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 22:57:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DflFG-0003bg-1w for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 17:04:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DflEI-0003TI-KM for emacs-devel@gnu.org; Tue, 07 Jun 2005 17:03:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DflEH-0003Sa-DT for emacs-devel@gnu.org; Tue, 07 Jun 2005 17:03:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DflEH-0003SQ-AL for emacs-devel@gnu.org; Tue, 07 Jun 2005 17:03:21 -0400 Original-Received: from [128.196.210.37] (helo=nsa2.srv.as.arizona.edu) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DflDr-0005JR-Eb for emacs-devel@gnu.org; Tue, 07 Jun 2005 17:02:55 -0400 Original-Received: from biff.as.arizona.edu (biff.as.arizona.edu [128.196.211.142]) by nsa2.srv.as.arizona.edu (8.12.10/8.12.10) with ESMTP id j57KxHH2023735 for ; Tue, 7 Jun 2005 13:59:17 -0700 Original-Received: from turtle.as.arizona.edu (IDENT:U2FsdGVkX18YMIFwGeBchD1+sYlfNR/yKSrlFnhRfp4@turtle.as.arizona.edu [128.196.208.207]) by biff.as.arizona.edu (8.12.8/8.12.8) with ESMTP id j57KxHCw026800; Tue, 7 Jun 2005 13:59:17 -0700 Original-To: Luc Teirlinck In-Reply-To: <200506071738.j57Hckj19457@raven.dms.auburn.edu> X-Mailer: Evolution 2.0.4 (2.0.4-4) X-Scanned-By: MIMEDefang 2.42 X-MailScanner: Found to be clean X-MailScanner-SpamCheck: so2: not spam, SpamAssassin (score=-1.295, required 8, autolearn=disabled, AWL -1.29) X-MailScanner-From: jdsmith@as.arizona.edu X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38278 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38278 On Tue, 2005-06-07 at 12:38 -0500, Luc Teirlinck wrote: > JD Smith wrote: > > I just compiled a CVS Emacs v22, and was pleased to find that there is > a new comint- prompt-read-only variable. However, when I enable that > variable, I get the following non-desired behavior: > > 1. At each prompt, I am warned "Text is read-only". > 2. All my input is echoed back to me (I use process-echoes). > > I thought my prompt pattern could be at fault; it contains a \r > character (which IDL throws in at odd intervals). I changed it to > something simple, and get the same behavior. > > Unless you set comint-use-prompt-regexp (formerly > comint-use-prompt-regexp-instead-of-fields) to t, the value of > shell-prompt-pattern will not matter very much. It looks like part of > the echoed input is considered part of the prompt. The prompt > read-only region includes the prompt and the newline before it. > > It is really difficult for me to look into this, because I can not > duplicate the problem. Trying to use idlwave-shell-mode (assuming > that is what we are talking about) I got: > > apply: Searching for program: no such file or directory, idl I turned on comint-use-prompt-regexp, with the same results. I have comint-process-echoes set, since IDL echoes input. If I turn it off, I don't get the "Text is read-only" warning, but of course get the echoed input. It appears that comint is attempting to delete some of the input which has already been marked read-only as a result of prompt-read-only. I've isolated the "Text is read-only" warning to line 1550 of comint.el: (delete-region comint-last-input-end (+ comint-last-input-end echo-len))))) This is in the segment of code which removes the duplicate input echoed. When process-echoes is set, this gets called, and results in the warning above. This results because the echoed input has apparently already been marked read-only, perhaps by having inherited that status from the prior prompt somehow. Here is an example input which delete-region failed to delete after having matched it: #("print,'foo'\n" 0 9 (front-sticky (read-only) read-only t inhibit- line-move-field-capture t field output rear-nonsticky t) 9 12 (inhibit- line-move-field-capture t field output rear-nonsticky t)) Thanks, JD