From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: comint read only prompt "leaking" properties Date: Wed, 07 Feb 2007 19:31:48 +0100 Message-ID: <85wt2tyg2z.fsf@lola.goethe.zz> References: <1170869305.2452.5.camel@turtle.as.arizona.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1170873145 31125 80.91.229.12 (7 Feb 2007 18:32:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Feb 2007 18:32:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: JD Smith Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 07 19:32:18 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HErab-0007hx-3b for ged-emacs-devel@m.gmane.org; Wed, 07 Feb 2007 19:32:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HEraa-0000Wj-KQ for ged-emacs-devel@m.gmane.org; Wed, 07 Feb 2007 13:32:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HEraO-0000WT-4Z for emacs-devel@gnu.org; Wed, 07 Feb 2007 13:32:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HEraM-0000Vx-BK for emacs-devel@gnu.org; Wed, 07 Feb 2007 13:32:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HEraM-0000Vr-79 for emacs-devel@gnu.org; Wed, 07 Feb 2007 13:32:02 -0500 Original-Received: from mail-in-10.arcor-online.net ([151.189.21.50]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HEraL-0005dd-Nk for emacs-devel@gnu.org; Wed, 07 Feb 2007 13:32:02 -0500 Original-Received: from mail-in-01-z2.arcor-online.net (mail-in-09-z2.arcor-online.net [151.189.8.21]) by mail-in-10.arcor-online.net (Postfix) with ESMTP id 0229126D42C; Wed, 7 Feb 2007 19:32:00 +0100 (CET) Original-Received: from mail-in-03.arcor-online.net (mail-in-03.arcor-online.net [151.189.21.43]) by mail-in-01-z2.arcor-online.net (Postfix) with ESMTP id E92C628EF2E; Wed, 7 Feb 2007 19:31:59 +0100 (CET) Original-Received: from lola.goethe.zz (dslb-084-061-034-178.pools.arcor-ip.net [84.61.34.178]) by mail-in-03.arcor-online.net (Postfix) with ESMTP id B3B6A275B32; Wed, 7 Feb 2007 19:31:59 +0100 (CET) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 1F7121C4CE1C; Wed, 7 Feb 2007 19:31:48 +0100 (CET) In-Reply-To: <1170869305.2452.5.camel@turtle.as.arizona.edu> (JD Smith's message of "Wed\, 07 Feb 2007 10\:28\:25 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-detected-kernel: Linux 2.4-2.6 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:66072 Archived-At: JD Smith writes: > The read only prompt enabled in COMINT modes by > `comint-prompt-read-only' can "leak" the read-only text property into > subsequent input. This inhibits the printing of the next prompt, and > garbles the input. The misplaced properties will also get saved on the > input ring, and can re-inject the troublesome text upon recalling > earlier input, even after the buffer is cleared. Steps to reproduce: > > M-x shell > M-x set-variable [Ret] comint-prompt-read-only [Ret] t [Ret] > > In the shell buffer: > > host% echo "foo" [Ret] > > Drag to highlight the prior command, including the space before "echo". > Paste it in at the new prompt. > > host% echo "foo" > > Hit Return to send the command. Note that a new prompt is not sent, > and that the input line keeps doubling in length. Examine the > properties along the input, to find that `front-sticky (read-only) > read-only t' has been littered across the input fields. > > I know of know general means to inhibit any property transfer when > pasting text in a given buffer, but if one did exist, that would be a > (heavy handed) solution. As another option, is there a text property > for "don't copy any of these properties"? I doubt anyone is ever > interested in copying properties from the prompt. In reality, though, > any read-only property pasted in from anywhere can cause trouble on the > COMINT command line. > > This is the list of prompt properties: > > (front-sticky (read-only) read-only t inhibit-line-move-field-capture t > field output rear-nonsticky t fontified t) Strange, this should not happen: yank-excluded-properties is a variable defined in `simple.el'. Its value is (read-only invisible intangible field mouse-face help-echo local-map keymap yank-handler follow-link fontified) Documentation: *Text properties to discard when yanking. The value should be a list of text properties to discard or t, which means to discard all text properties. You can customize this variable. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum