emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: recently introduced bug in minibuffer handling


From: Michael Kifer
Subject: Re: recently introduced bug in minibuffer handling
Date: Mon, 26 Dec 2005 19:07:27 -0500

Yes, the bug is still there with the very latest version.
I made a small typo and an omission when I described the case, but one
would probably figure it out anyway:

The two definitions below and the call
(read-file-name "foo")
should be evaluated with C-xC-e and not with C-cC-e, of course.
Also, after you type something (e.g., foobar) after the prompt, finish up
by pressing Enter.

> I tried this now, and the bug does not seem to happen.
> Does it still fail for you?
> 
> 
> (defadvice read-file-name (around read-filename-advice activate)
>     "Tell `exit-minibuffer' to run a hook."
>     (let ((minibuffer-exit-hook
>          (append minibuffer-exit-hook '(my-minibuffer-hook))))
>       ad-do-it))
> 
> (defun my-minibuffer-hook ()
>   "Manipulate the minibuffer before exiting it."
>   (goto-char (minibuffer-prompt-end))
>   (end-of-line)
>   (message "current point: %d "  (point))
>   (message "max point: %d "  (point-max))
>   )
> 
> Then evaluate
> (read-file-name "foo")
> for instance, with C-cC-e
> When you see a prompt, type something at the end.
> For instance, type ~/.emacs to the end of the stuff that shows in the
> minibuffer.
> You will see (in *Messages*) that current point and max point are different!
> The current point will be at the end of the prompt instead of at the end of
> what you typed.
> 
> Now, if you remove (goto-char (minibuffer-prompt-end)) at the beginning
> of the hook and repeat the experiment then you will see that the current point
> and the max point are the same. So, something gets messed up.
> 






reply via email to

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