[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

comint read only prompt "leaking" properties

From: JD Smith
Subject: comint read only prompt "leaking" properties
Date: Wed, 07 Feb 2007 10:28:25 -0700

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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]