[Top][All Lists]

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

Re: I-search: Clicking in minibuf during I-search fails.

From: Juri Linkov
Subject: Re: I-search: Clicking in minibuf during I-search fails.
Date: Mon, 22 Oct 2007 03:35:43 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

>     This bug is caused by the hack in `isearch-edit-string' that uses
>       (let ((cursor-in-echo-area t))
>            (read-event))
>     before reading the search string in the minibuffer with
>     `read-from-minibuffer'.  When clicking mouse-1 in `read-event'
>     above, it incorrectly handles the mouse click.
> Why does this code handle the mouse-click at all?
> It ought to just return the event, right?

It doesn't read the mouse button release event (mouse-1), so the mouse
release happens in the minibuffer after read-from-minibuffer activates it.
Thus, mouse-1 selects the region because read-from-minibuffer with the
pressed down-mouse-1 puts the mark to the beginning of the minibuffer
(before the prompt).

Below is the test case that emulates this problem in `isearch-edit-string':

  (message "Prompt: ")
  (let ((cursor-in-echo-area t))
  (read-from-minibuffer "Prompt: "))

after evaluating you can try to press mouse-1 in the echo area,
and release it in the minibuffer.

Juri Linkov

reply via email to

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