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: David Kastrup
Subject: Re: Keymaps on images have pretty much stopped working
Date: 04 Jan 2004 20:41:31 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Richard Stallman <address@hidden> writes:

> How about if you try inserting some debugging code in xterm.c, where
> it finds the image, or in intervals.c where it looks up the keymap (it
> could be get_keymap), to record various data?  That way, after it
> fails, you can look at the data in GDB and learn something about where
> control passed and what data was wrong.
> 
> It may take a few times doing this, saving different data,
> to get to the bottom of things, but you can be assured of getting there
> and it won't take terribly long.

I am pretty much clueless about Emacs internals.  Sigh.  Before 21.1
came out, I had to prepare oodles and oodles of examples for Gerd
when things went wrong.  It would be so much easier if people just
used preview-latex.  Ok, I'll try again to make an example.

(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.  And with larger
buffers with lots of icons I also had the situation where the wrong
icons thought they were clicked on.

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


-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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