[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] Re: backward-kill-word in minibuffer
From: |
Anders Lindgren |
Subject: |
Re: [h-e-w] Re: backward-kill-word in minibuffer |
Date: |
19 Dec 2001 13:33:07 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
I wrote:
> Aha! This is why my electric minibuffer commands stopped working!
>
> Is there a way to find the location where the prompt ends or do I
> explicitly have to check the presence of a read-only text property?
Roman Belenov <address@hidden> writes:
> Does checking "Inviolable" on customization form for
> minibuffer-prompt-properties help ?
Nope!
It only stopped me from walking into the prompt.
My own electric commands look like the following piece of code.
(defun minibuffer-electric-tilde ()
(interactive)
(if (eq ?/ (preceding-char))
(delete-region (point-min) (point)))
(insert ?~))
The commands are added to a minor mode keymap enabled using
`minibuffer-setup-hook'.
Oh, well, the problem is that the code assumes that only the file name
is present in the buffer and hence tries to delete everything from
`point-min' to the `point'. In order to make it work for the new
situation would be to replace `point-min' with something like
`minibuffer-prompt-end', or similar.
To write my own `minibuffer-prompt-end' would not be that much of a
problem, except that 1) if one already existed that would be better to
use, and 2) I would have to rely on the internal workings of the
current implementation, making it likely that my code would fail in
the future if the implementation would change.
-- Anders
--
;; .signature -- File added to the end of mail, containing joke or info.
(defvar me '((profession . "Compiler Designer") (company . "IAR Systems")
(age . 32) (country . "Sweden") (hair . "Long") (lindy-hopper . t)))
;; .signature ends here.