GNU bug report logs - #20508
24.4; image map properties not working as described

Previous Next

Package: emacs;

Reported by: pma <pma <at> rdorte.org>

Date: Tue, 5 May 2015 15:35:02 UTC

Severity: normal

Found in version 24.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 20508 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: pma <pma <at> rdorte.org>
Cc: 20508 <at> debbugs.gnu.org
Subject: Re: bug#20508: 24.4; image map properties not working as described
Date: Tue, 05 May 2015 19:32:01 +0300
> From: pma <pma <at> rdorte.org>
> Date: Tue, 05 May 2015 11:28:26 +0200
> 
> 
> - emacs -Q
> - insert this function:
> (defun image-wipe-and-insert ()
>   (interactive)
>   (let ()
>     (with-current-buffer (get-buffer-create "*an image area test buffer*")
>       (switch-to-buffer (current-buffer))
>       (erase-buffer)
>       (insert-image (find-image '((:type png :file "/usr/share/emacs/24.4/etc/images/icons/hicolor/128x128/apps/emacs.png"
>                      :map  '((rect . ((0 . 0) . (50 . 50))) anAreaID (:pointer hourglass :help-echo "You found an area!"))
>                      ;; :relief -20
>                      ;; :conversion laplace
>                      :margin (0 . 0)
>                      :pointer arrow)))))))
> 
> - M-x image-wipe-and-insert
> - Point mouse into top left corner
> - results:
>   - change of pointer, but not to hourglass;
>   - no help-echo message.

It's a cockpit error: you should use 'pointer', not ':pointer' in the
first instance.  IOW, this works for me (note the underlined part):

(defun image-wipe-and-insert ()
  (interactive)
  (let ()
    (with-current-buffer (get-buffer-create "*an image area test buffer*")
      (switch-to-buffer (current-buffer))
      (erase-buffer)
      (insert-image (find-image '((:type png :file "/usr/share/emacs/24.4/etc/images/icons/hicolor/128x128/apps/emacs.png"
                     :map  '((rect . ((0 . 0) . (50 . 50))) anAreaID (pointer hourglass :help-echo "You found an area!"))
                     ;;                                               ^^^^^^^
                     ;; :relief -20
                     ;; :conversion laplace
                     :margin (0 . 0)
                     :pointer arrow)))))))

(Yes, it's confusing to have ':pointer' on the top level and 'pointer'
inside the value for ':map'.  But the manual correctly says 'pointer'
in the latter case, so at least the documentation is consistent with
the code.)




This bug report was last modified 10 years and 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.