[Top][All Lists]

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

Viper doesn't properly handle C-h k for mouse clicks

From: Chong Yidong
Subject: Viper doesn't properly handle C-h k for mouse clicks
Date: Sat, 17 Mar 2007 16:32:47 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

"Lennart Borgman (gmail)" <address@hidden> writes:

> I am little bit ashamed to say that it seems to be some problem with
> Viper. I will contact Michael Kifer.

The problem, despite the original bug report, has nothing to do with
text properties.  With viper on, do C-h k and click anywhere with the
mouse.  You will see that only the down-mouse binding gets reported;
in comparison, when viper is off, the up-mouse binding also gets

The problem is that viper handles describe-key using advice. In
viper.el:1028, we find the following code:

  (defadvice describe-key (before viper-describe-key-ad protect activate)
    "Force to read key via `viper-read-key-sequence'."
    (interactive (list (viper-read-key-sequence "Describe key: "))))

This changes the interactive form of describe-key.  Unfortunately, the
real interactive form of describe-key isn't read-key-sequence---it's a
complicated 35-line-long Lisp function, whose goal is (among other
things) to capture the up-events corresponding to down-mouse events!

If viper really has to use advice, it's better to use around-advice:
instead of changing describe-key's interactive spec, allow
describe-key's interactive spec parse the mouse events, then change
the KEY argument *afterwards*.

(In the long run, I think we should change viper to avoid using
advice, but I don't think it's feasible in the Emacs 22 time frame;
OTOH, this would be a significant change.)

reply via email to

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