unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* comint read only prompt "leaking" properties
@ 2007-02-07 17:28 JD Smith
  2007-02-07 18:31 ` David Kastrup
  0 siblings, 1 reply; 3+ messages in thread
From: JD Smith @ 2007-02-07 17:28 UTC (permalink / raw)
  To: emacs-devel


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)

JD

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-07 18:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-07 17:28 comint read only prompt "leaking" properties JD Smith
2007-02-07 18:31 ` David Kastrup
2007-02-07 18:42   ` JD Smith

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).