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: Richard M. Stallman
Subject: Re: recently introduced bug in minibuffer handling
Date: Mon, 26 Dec 2005 13:43:25 -0500

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]