unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: JD Smith <jdsmith@as.arizona.edu>
To: emacs-devel@gnu.org
Subject: comint read only prompt "leaking" properties
Date: Wed, 07 Feb 2007 10:28:25 -0700	[thread overview]
Message-ID: <1170869305.2452.5.camel@turtle.as.arizona.edu> (raw)


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

             reply	other threads:[~2007-02-07 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 17:28 JD Smith [this message]
2007-02-07 18:31 ` comint read only prompt "leaking" properties David Kastrup
2007-02-07 18:42   ` JD Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1170869305.2452.5.camel@turtle.as.arizona.edu \
    --to=jdsmith@as.arizona.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).