[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: comint read only prompt "leaking" properties
From: |
David Kastrup |
Subject: |
Re: comint read only prompt "leaking" properties |
Date: |
Wed, 07 Feb 2007 19:31:48 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) |
JD Smith <address@hidden> 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