unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
@ 2007-03-05  2:56 Richard Stallman
  2007-03-05 15:27 ` Chong Yidong
  0 siblings, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2007-03-05  2:56 UTC (permalink / raw)
  To: emacs-devel

Would someone please debug this and ack?

------- Start of forwarded message -------
Date: Thu, 22 Feb 2007 15:28:14 +0100
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
MIME-Version: 1.0
To: "emacs-pretest-bug@gnu.org" <emacs-pretest-bug@gnu.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Subject: C-h k does not catch text properies keymaps
X-Spam-Status: No, score=0.5 required=5.0 tests=TO_ADDRESS_EQ_REAL 
	autolearn=no version=3.0.4

Using C-h k to check mouse bindings does not work for text property keymaps.

To show this do

    emacs -Q

then paste the following code in the *Scratch* buffer and eval it:

(defun temp-test-mouse-ctrl-h-k()
   (interactive)
   (switch-to-buffer-other-window (get-buffer-create "test mouse buffer"))
   (goto-char (point-max))
   (let ((map (make-sparse-keymap))
         (txt "click here"))
     (define-key map [mouse-1] '(lambda()
                                  "This is the lambda for mouse-1"
                                  (interactive)
                                  (message "lambda for mouse-1 here")))
     (define-key map [f2] '(lambda()
                             "This is the lambda for f2"
                             (interactive)
                             (message "lambda for f2 here")))
     (put-text-property 0 (length txt) 'face '(:underline t :foreground 
"red") txt)
     (put-text-property 0 (length txt) 'mouse-face 'highlight txt)
     (put-text-property 0 (length txt) 'keymap map txt)
     (insert "\n" txt)
     ))

Do

    M-x temp-test-mouse-ctrl-h-k
    C-h k

and then click the red underlined text with mouse button 1. It will say

   <down-mouse-1> at that spot runs the command mouse-drag-region

which is not correct.


In GNU Emacs 22.0.93.1 (i386-mingw-nt5.1.2600)
  of 2007-02-19


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05  2:56 [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps] Richard Stallman
@ 2007-03-05 15:27 ` Chong Yidong
  2007-03-05 21:21   ` David Kastrup
  2007-03-05 21:50   ` Richard Stallman
  0 siblings, 2 replies; 18+ messages in thread
From: Chong Yidong @ 2007-03-05 15:27 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Would someone please debug this and ack?

Didn't David Kastrup rewrite the key-binding code a few months ago, to
handle this case?

> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> Subject: C-h k does not catch text properies keymaps
> To: "emacs-pretest-bug@gnu.org" <emacs-pretest-bug@gnu.org>
>
> Using C-h k to check mouse bindings does not work for text property keymaps.
>
> To show this do
>
>    emacs -Q
>
> then paste the following code in the *Scratch* buffer and eval it:
>
> (defun temp-test-mouse-ctrl-h-k()
>   (interactive)
>   (switch-to-buffer-other-window (get-buffer-create "test mouse buffer"))
>   (goto-char (point-max))
>   (let ((map (make-sparse-keymap))
>         (txt "click here"))
>     (define-key map [mouse-1] '(lambda()
>                                  "This is the lambda for mouse-1"
>                                  (interactive)
>                                  (message "lambda for mouse-1 here")))
>     (define-key map [f2] '(lambda()
>                             "This is the lambda for f2"
>                             (interactive)
>                             (message "lambda for f2 here")))
>     (put-text-property 0 (length txt) 'face '(:underline t :foreground
> "red") txt)
>     (put-text-property 0 (length txt) 'mouse-face 'highlight txt)
>     (put-text-property 0 (length txt) 'keymap map txt)
>     (insert "\n" txt)
>     ))
>
> Do
>
>    M-x temp-test-mouse-ctrl-h-k
>    C-h k
>
> and then click the red underlined text with mouse button 1. It will say
>
>   <down-mouse-1> at that spot runs the command mouse-drag-region
>
> which is not correct.
>
>
> In GNU Emacs 22.0.93.1 (i386-mingw-nt5.1.2600)
>  of 2007-02-19
>
>
> _______________________________________________
> emacs-pretest-bug mailing list
> emacs-pretest-bug@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
> ----------
>
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 15:27 ` Chong Yidong
@ 2007-03-05 21:21   ` David Kastrup
  2007-03-05 21:33     ` Lennart Borgman (gmail)
  2007-03-05 21:50   ` Richard Stallman
  1 sibling, 1 reply; 18+ messages in thread
From: David Kastrup @ 2007-03-05 21:21 UTC (permalink / raw)
  To: Chong Yidong; +Cc: rms, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Richard Stallman <rms@gnu.org> writes:
>
>> Would someone please debug this and ack?
>
> Didn't David Kastrup rewrite the key-binding code a few months ago, to
> handle this case?

The "problem" is more with `describe-key'.  However:

>> (defun temp-test-mouse-ctrl-h-k()
>>   (interactive)
>>   (switch-to-buffer-other-window (get-buffer-create "test mouse buffer"))
>>   (goto-char (point-max))
>>   (let ((map (make-sparse-keymap))
>>         (txt "click here"))
>>     (define-key map [mouse-1] '(lambda()
>>                                  "This is the lambda for mouse-1"
>>                                  (interactive)
>>                                  (message "lambda for mouse-1 here")))
>>     (define-key map [f2] '(lambda()
>>                             "This is the lambda for f2"
>>                             (interactive)
>>                             (message "lambda for f2 here")))
>>     (put-text-property 0 (length txt) 'face '(:underline t :foreground
>> "red") txt)
>>     (put-text-property 0 (length txt) 'mouse-face 'highlight txt)
>>     (put-text-property 0 (length txt) 'keymap map txt)
>>     (insert "\n" txt)
>>     ))
>>
>> Do
>>
>>    M-x temp-test-mouse-ctrl-h-k
>>    C-h k
>>
>> and then click the red underlined text with mouse button 1. It will say
>>
>>   <down-mouse-1> at that spot runs the command mouse-drag-region
>>
>> which is not correct.

Actually, it _is_ correct.  Do

M-x debug-on-entry RET mouse-drag-region RET

and you'll find that clicking at that spot indeed first runs
mouse-drag-region.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 21:21   ` David Kastrup
@ 2007-03-05 21:33     ` Lennart Borgman (gmail)
  2007-03-05 22:11       ` Chong Yidong
  2007-03-06 16:01       ` [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps] Richard Stallman
  0 siblings, 2 replies; 18+ messages in thread
From: Lennart Borgman (gmail) @ 2007-03-05 21:33 UTC (permalink / raw)
  To: David Kastrup; +Cc: Chong Yidong, rms, emacs-devel

David Kastrup wrote:
> Chong Yidong <cyd@stupidchicken.com> writes:
> 
>> Richard Stallman <rms@gnu.org> writes:
>>
>>> Would someone please debug this and ack?
>> Didn't David Kastrup rewrite the key-binding code a few months ago, to
>> handle this case?
> 
> The "problem" is more with `describe-key'.  However:
> 
>>> (defun temp-test-mouse-ctrl-h-k()
>>>   (interactive)
>>>   (switch-to-buffer-other-window (get-buffer-create "test mouse buffer"))
>>>   (goto-char (point-max))
>>>   (let ((map (make-sparse-keymap))
>>>         (txt "click here"))
>>>     (define-key map [mouse-1] '(lambda()
>>>                                  "This is the lambda for mouse-1"
>>>                                  (interactive)
>>>                                  (message "lambda for mouse-1 here")))
>>>     (define-key map [f2] '(lambda()
>>>                             "This is the lambda for f2"
>>>                             (interactive)
>>>                             (message "lambda for f2 here")))
>>>     (put-text-property 0 (length txt) 'face '(:underline t :foreground
>>> "red") txt)
>>>     (put-text-property 0 (length txt) 'mouse-face 'highlight txt)
>>>     (put-text-property 0 (length txt) 'keymap map txt)
>>>     (insert "\n" txt)
>>>     ))
>>>
>>> Do
>>>
>>>    M-x temp-test-mouse-ctrl-h-k
>>>    C-h k
>>>
>>> and then click the red underlined text with mouse button 1. It will say
>>>
>>>   <down-mouse-1> at that spot runs the command mouse-drag-region
>>>
>>> which is not correct.
> 
> Actually, it _is_ correct.  Do
> 
> M-x debug-on-entry RET mouse-drag-region RET
> 
> and you'll find that clicking at that spot indeed first runs
> mouse-drag-region.


Ok, thanks. I can see it is partly correct and useful. But the 
information about the other function, should not that be shown too?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 15:27 ` Chong Yidong
  2007-03-05 21:21   ` David Kastrup
@ 2007-03-05 21:50   ` Richard Stallman
  1 sibling, 0 replies; 18+ messages in thread
From: Richard Stallman @ 2007-03-05 21:50 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

    Didn't David Kastrup rewrite the key-binding code a few months ago, to
    handle this case?

I don't remember, but this bug report was from Feb 22.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 21:33     ` Lennart Borgman (gmail)
@ 2007-03-05 22:11       ` Chong Yidong
  2007-03-05 22:35         ` Lennart Borgman (gmail)
  2007-03-06 16:01       ` [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps] Richard Stallman
  1 sibling, 1 reply; 18+ messages in thread
From: Chong Yidong @ 2007-03-05 22:11 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: rms, emacs-devel

"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:

>> Actually, it _is_ correct.  Do
>>
>> M-x debug-on-entry RET mouse-drag-region RET
>>
>> and you'll find that clicking at that spot indeed first runs
>> mouse-drag-region.
>
>
> Ok, thanks. I can see it is partly correct and useful. But the
> information about the other function, should not that be shown too?

What I see in the help buffer, following your test code, is the
following; both the down-mouse and up-mouse event are reported, so I
don't think there's a bug present:

<down-mouse-1> at that spot runs the command mouse-drag-region
  which is an interactive compiled Lisp function in `mouse.el'.
It is bound to <down-mouse-1>.
(mouse-drag-region start-event)

Set the region to the text that the mouse is dragged over.
Highlight the drag area as you move the mouse.
This must be bound to a button-down mouse event.
In Transient Mark mode, the highlighting remains as long as the mark
remains active.  Otherwise, it remains until the next input event.

If the click is in the echo area, display the `*Messages*' buffer.

----------------- up-event ----------------

<mouse-1> at that spot runs the command (lambda nil "This is the lambda for mouse-1" (interactive) (message "lambda for mouse-1 here"))
  which is an interactive Lisp function.
It is bound to <mouse-1>.
(anonymous)

This is the lambda for mouse-1

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 22:11       ` Chong Yidong
@ 2007-03-05 22:35         ` Lennart Borgman (gmail)
  2007-03-05 22:38           ` Chong Yidong
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Borgman (gmail) @ 2007-03-05 22:35 UTC (permalink / raw)
  To: Chong Yidong; +Cc: rms, emacs-devel

Chong Yidong wrote:
> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
> 
>>> Actually, it _is_ correct.  Do
>>>
>>> M-x debug-on-entry RET mouse-drag-region RET
>>>
>>> and you'll find that clicking at that spot indeed first runs
>>> mouse-drag-region.
>>
>> Ok, thanks. I can see it is partly correct and useful. But the
>> information about the other function, should not that be shown too?
> 
> What I see in the help buffer, following your test code, is the
> following; both the down-mouse and up-mouse event are reported, so I
> don't think there's a bug present:
> 
> <down-mouse-1> at that spot runs the command mouse-drag-region
>   which is an interactive compiled Lisp function in `mouse.el'.
> It is bound to <down-mouse-1>.
> (mouse-drag-region start-event)
> 
> Set the region to the text that the mouse is dragged over.
> Highlight the drag area as you move the mouse.
> This must be bound to a button-down mouse event.
> In Transient Mark mode, the highlighting remains as long as the mark
> remains active.  Otherwise, it remains until the next input event.
> 
> If the click is in the echo area, display the `*Messages*' buffer.
> 
> ----------------- up-event ----------------
> 
> <mouse-1> at that spot runs the command (lambda nil "This is the lambda for mouse-1" (interactive) (message "lambda for mouse-1 here"))
>   which is an interactive Lisp function.
> It is bound to <mouse-1>.
> (anonymous)
> 
> This is the lambda for mouse-1

I do not see the up-event part on CVS Emacs from 2007-03-04 on w32.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 22:35         ` Lennart Borgman (gmail)
@ 2007-03-05 22:38           ` Chong Yidong
  2007-03-05 23:30             ` Lennart Borgman (gmail)
  2007-03-06 22:36             ` Richard Stallman
  0 siblings, 2 replies; 18+ messages in thread
From: Chong Yidong @ 2007-03-05 22:38 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: rms, emacs-devel

"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:

>> ----------------- up-event ----------------
>>
>> <mouse-1> at that spot runs the command (lambda nil "This is the lambda for mouse-1" (interactive) (message "lambda for mouse-1 here"))
>>   which is an interactive Lisp function.
>> It is bound to <mouse-1>.
>> (anonymous)
>>
>> This is the lambda for mouse-1
>
> I do not see the up-event part on CVS Emacs from 2007-03-04 on w32.

Works for me on GNU/Linux with latest CVS.  I guess it's a Windows
bug.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 22:38           ` Chong Yidong
@ 2007-03-05 23:30             ` Lennart Borgman (gmail)
  2007-03-06 22:36             ` Richard Stallman
  1 sibling, 0 replies; 18+ messages in thread
From: Lennart Borgman (gmail) @ 2007-03-05 23:30 UTC (permalink / raw)
  To: Chong Yidong; +Cc: rms, emacs-devel

Chong Yidong wrote:
> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
> 
>>> ----------------- up-event ----------------
>>>
>>> <mouse-1> at that spot runs the command (lambda nil "This is the lambda for mouse-1" (interactive) (message "lambda for mouse-1 here"))
>>>   which is an interactive Lisp function.
>>> It is bound to <mouse-1>.
>>> (anonymous)
>>>
>>> This is the lambda for mouse-1
>> I do not see the up-event part on CVS Emacs from 2007-03-04 on w32.
> 
> Works for me on GNU/Linux with latest CVS.  I guess it's a Windows
> bug.

I just verified that I still do not see the up-event part on w32 with a 
fresh checkout.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 21:33     ` Lennart Borgman (gmail)
  2007-03-05 22:11       ` Chong Yidong
@ 2007-03-06 16:01       ` Richard Stallman
  2007-03-06 17:25         ` Lennart Borgman (gmail)
  1 sibling, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2007-03-06 16:01 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: cyd, emacs-devel

    Ok, thanks. I can see it is partly correct and useful. But the 
    information about the other function, should not that be shown too?

There is no way to enter just an up-event as argument to C-h k.  So,
in the case where the down-event has a binding, there is no way to ask
about the up-event's binding.

Since the up-event will always follow the down-event in practice, it
would be useful for C-h k to mention that the up-event has a binding
too.  That would be more convenient and natural than implementing
a separate way to ask for the up-event.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-06 16:01       ` [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps] Richard Stallman
@ 2007-03-06 17:25         ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 18+ messages in thread
From: Lennart Borgman (gmail) @ 2007-03-06 17:25 UTC (permalink / raw)
  To: rms; +Cc: cyd, emacs-devel

Richard Stallman wrote:
>     Ok, thanks. I can see it is partly correct and useful. But the 
>     information about the other function, should not that be shown too?
> 
> There is no way to enter just an up-event as argument to C-h k.  So,
> in the case where the down-event has a binding, there is no way to ask
> about the up-event's binding.
> 
> Since the up-event will always follow the down-event in practice, it
> would be useful for C-h k to mention that the up-event has a binding
> too.  That would be more convenient and natural than implementing
> a separate way to ask for the up-event.


It seems according to the answer from Chong that this already works on 
GNU/Linux, but for some reason it does not work on w32.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-05 22:38           ` Chong Yidong
  2007-03-05 23:30             ` Lennart Borgman (gmail)
@ 2007-03-06 22:36             ` Richard Stallman
  2007-03-06 22:48               ` Lennart Borgman (gmail)
  1 sibling, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2007-03-06 22:36 UTC (permalink / raw)
  To: Chong Yidong; +Cc: lennart.borgman, emacs-devel

    >> ----------------- up-event ----------------
    >>
    >> <mouse-1> at that spot runs the command (lambda nil "This is the lambda for mouse-1" (interactive) (message "lambda for mouse-1 here"))
    >>   which is an interactive Lisp function.
    >> It is bound to <mouse-1>.
    >> (anonymous)
    >>
    >> This is the lambda for mouse-1
    >
    > I do not see the up-event part on CVS Emacs from 2007-03-04 on w32.

    Works for me on GNU/Linux with latest CVS.  I guess it's a Windows
    bug.

Lennart, can you see the code that shows the up-event, and find
out why it does not work when you try it?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-06 22:36             ` Richard Stallman
@ 2007-03-06 22:48               ` Lennart Borgman (gmail)
  2007-03-07  9:10                 ` Richard Stallman
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Borgman (gmail) @ 2007-03-06 22:48 UTC (permalink / raw)
  To: rms; +Cc: Chong Yidong, emacs-devel

Richard Stallman wrote:
>     >> ----------------- up-event ----------------
>     >>
>     >> <mouse-1> at that spot runs the command (lambda nil "This is the lambda for mouse-1" (interactive) (message "lambda for mouse-1 here"))
>     >>   which is an interactive Lisp function.
>     >> It is bound to <mouse-1>.
>     >> (anonymous)
>     >>
>     >> This is the lambda for mouse-1
>     >
>     > I do not see the up-event part on CVS Emacs from 2007-03-04 on w32.
> 
>     Works for me on GNU/Linux with latest CVS.  I guess it's a Windows
>     bug.
> 
> Lennart, can you see the code that shows the up-event, and find
> out why it does not work when you try it?

up-event is nil.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-06 22:48               ` Lennart Borgman (gmail)
@ 2007-03-07  9:10                 ` Richard Stallman
  2007-03-07 12:01                   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2007-03-07  9:10 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: cyd, emacs-devel

    > Lennart, can you see the code that shows the up-event, and find
    > out why it does not work when you try it?

    up-event is nil.

Now you are starting to debug.  But you have not yet found the cause
of the problem.

What occurrences led to up-event's being nil there?
Where should it have been set to something non-nil,
and what actually happened when that code was executed?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps]
  2007-03-07  9:10                 ` Richard Stallman
@ 2007-03-07 12:01                   ` Lennart Borgman (gmail)
  2007-03-17 20:32                     ` Viper doesn't properly handle C-h k for mouse clicks Chong Yidong
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Borgman (gmail) @ 2007-03-07 12:01 UTC (permalink / raw)
  To: rms; +Cc: Michael Kifer, emacs-devel

Richard Stallman wrote:
>     > Lennart, can you see the code that shows the up-event, and find
>     > out why it does not work when you try it?
> 
>     up-event is nil.
> 
> Now you are starting to debug.  But you have not yet found the cause
> of the problem.
> 
> What occurrences led to up-event's being nil there?
> Where should it have been set to something non-nil,
> and what actually happened when that code was executed?

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Viper doesn't properly handle C-h k for mouse clicks
  2007-03-07 12:01                   ` Lennart Borgman (gmail)
@ 2007-03-17 20:32                     ` Chong Yidong
  2007-03-21 16:19                       ` Chong Yidong
  0 siblings, 1 reply; 18+ messages in thread
From: Chong Yidong @ 2007-03-17 20:32 UTC (permalink / raw)
  To: Michael Kifer; +Cc: emacs-devel

"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> 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
reported.

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.)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Viper doesn't properly handle C-h k for mouse clicks
  2007-03-17 20:32                     ` Viper doesn't properly handle C-h k for mouse clicks Chong Yidong
@ 2007-03-21 16:19                       ` Chong Yidong
  2007-03-21 17:01                         ` Michael Kifer
  0 siblings, 1 reply; 18+ messages in thread
From: Chong Yidong @ 2007-03-21 16:19 UTC (permalink / raw)
  To: Michael Kifer; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> The problem is that viper handles describe-key using advice.

Since there has been no response, I went ahead and hacked the viper
advice so that it works for this case at least.  We should revisit
this issue after the release.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Viper doesn't properly handle C-h k for mouse clicks
  2007-03-21 16:19                       ` Chong Yidong
@ 2007-03-21 17:01                         ` Michael Kifer
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Kifer @ 2007-03-21 17:01 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel


> Chong Yidong <cyd@stupidchicken.com> writes:
> 
> > The problem is that viper handles describe-key using advice.
> 
> Since there has been no response, I went ahead and hacked the viper
> advice so that it works for this case at least.  We should revisit
> this issue after the release.
> 


sorry, I didn't have the time to look into this.
did you commit? I'll take a look then.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-03-21 17:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-05  2:56 [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps] Richard Stallman
2007-03-05 15:27 ` Chong Yidong
2007-03-05 21:21   ` David Kastrup
2007-03-05 21:33     ` Lennart Borgman (gmail)
2007-03-05 22:11       ` Chong Yidong
2007-03-05 22:35         ` Lennart Borgman (gmail)
2007-03-05 22:38           ` Chong Yidong
2007-03-05 23:30             ` Lennart Borgman (gmail)
2007-03-06 22:36             ` Richard Stallman
2007-03-06 22:48               ` Lennart Borgman (gmail)
2007-03-07  9:10                 ` Richard Stallman
2007-03-07 12:01                   ` Lennart Borgman (gmail)
2007-03-17 20:32                     ` Viper doesn't properly handle C-h k for mouse clicks Chong Yidong
2007-03-21 16:19                       ` Chong Yidong
2007-03-21 17:01                         ` Michael Kifer
2007-03-06 16:01       ` [lennart.borgman@gmail.com: C-h k does not catch text properies keymaps] Richard Stallman
2007-03-06 17:25         ` Lennart Borgman (gmail)
2007-03-05 21:50   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).