emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Re: mouse-yank-at-point in Comint modes]


From: Chong Yidong
Subject: Re: address@hidden: Re: mouse-yank-at-point in Comint modes]
Date: 29 Jan 2007 10:44:03 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

address@hidden (Johan Bockgård) writes:

> is this the correct thing to do when
> mouse-yank-at-point is nil?:
> 
>    +  ;; Fall back to the global definition if (i) the selected
>    +  ;; buffer is not a comint buffer (which can happen if a
>    +  ;; non-comint window was selected and we clicked in a comint
>    +  ;; window) [...]
> 
> Shouldn't the binding be looked up where you click in this case?

That is tricky to implement, because looking up the key binding of a
mouse event automagically uses the keymaps of the clicked window,
which may not be the selected window (see the definition of
Fkey_binding), so we are back where we started.

Also, there are situations where the alternative you suggest is
undesirable; if the selected buffer is in some other mode where
mouse-2 is not bound to mouse-yank-at-click and you click on a comint
buffer in another window, the value of mouse-yank-at-point is
irrelevant, so we should use the global binding!

The current solution seems to be good enough for all realistic
situations.

> Btw, the manual's description of what effect mouse-yank-at-point
> is supposed to have is confused:
> 
> (info "(emacs)Secondary Selection")
> 
>    If `mouse-yank-at-point' is non-`nil', `M-Mouse-2' yanks at point.
>    Then it does not matter precisely where you click; ALL THAT MATTERS
>    IS WHICH WINDOW YOU CLICK ON.

This is indeed incorrect; I'll fix it.




reply via email to

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