[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: M-x moves over prefix text in minibuffer
From: |
Kim F. Storm |
Subject: |
Re: M-x moves over prefix text in minibuffer |
Date: |
09 Jan 2002 09:56:24 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
eliz@is.elta.co.il (Eli Zaretskii) writes:
> On Tue, 8 Jan 2002, Jonathan Kamens wrote:
>
> > Type M-x, then type M-x
>
> I assume you meant M-b instead of the second M-x.
>
> > and your cursor moves back over the 'x' in
> > "M-x" in the minibuffer. Then when you try to type a command, you get
> > "Text is read-only". You shouldn't be able to move the cursor back
> > onto the prefix or prompt text in the minibuffer. In Emacs 20, you
> > can't.
>
> It's a feature. It lets you, for example, copy parts of the
> minibuffer prompt to the kill ring. If you don't like the new
> behavior, customize the variable minibuffer-prompt-properties and turn
> on the Inviolable property. (This is in NEWS, btw.)
I suggest to set the Inviolable property by default and make the
following simple modification to minibuffer-avoid-prompt:
(defun minibuffer-avoid-prompt (new old)
"A point-motion hook for the minibuffer, that moves point out of the prompt."
(if (= (point) (1- (minibuffer-prompt-end)))
(constrain-to-field nil (point-max))))
This has the nice feature that backward-char does not move into the
prompt, but you can still `jump' into the prompt (e.g. using M-b) or
copy text from it using the mouse.
--
Kim F. Storm http://www.cua.dk