emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Keymaps on images have pretty much stopped working


From: Kim F. Storm
Subject: Re: Keymaps on images have pretty much stopped working
Date: 05 Jan 2004 01:06:37 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

David Kastrup <address@hidden> writes:

> Ok, I'll try again to make an example.

Thanks.  I'll look into this asap.

> 
> (defun click-echo (event) (interactive "e") (message "Pressed: %S" event))
> (defun test-case nil (interactive)
>   (let ((keymap (make-sparse-keymap)) ov)
>    (define-key keymap [mouse-2] 'click-echo)
>    (switch-to-buffer (generate-new-buffer "*test*"))
>    (insert (propertize "x" 'display (create-image "emacs.xbm")
>         'keymap keymap)
>         "\n\nvisible")
>    (setq ov (make-overlay 3 10))
>    (overlay-put ov
>         'before-string (propertize "x" 'display (create-image "emacs.xbm")
>         'keymap keymap))))
> 
> Just run test-case and then try clicking with middle mouse key on the
> first and the second icon.  The first may still work out, but the
> second simply does not get its keymap active.  

That's what I get too.  I do have an idea what's wrong.


>                                                And with larger
> buffers with lots of icons I also had the situation where the wrong
> icons thought they were clicked on.
> 

My recent changes might have fixed that; there were some slight pixel offset
problems when determining whether the mouse was over an image which I fixed.
But since keymaps are broken now, you cannot test if it has been fixed...

> Pressing C-h k followed by a middle mouse click on either icon causes
> an error (with backtrace if debug-on-error is t).

The problem seems to be that the object clicked on may now be an image
in addition to a string; I guess I will have to rework my image map
patch to keep track of both the string and the image property.

-- 
Kim F. Storm  http://www.cua.dk





reply via email to

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