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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: patrick mc allister <pma <at> rdorte.org>
Cc: 20508 <at> debbugs.gnu.org
Subject: bug#20508: 24.4; image map properties not working as described
Date: Tue, 05 May 2015 22:14:31 +0300
> Date: Tue, 5 May 2015 19:27:54 +0200
> From: patrick mc allister <pma <at> rdorte.org>
> Cc: 20508 <at> debbugs.gnu.org
> 
> Now, however, I have a follow-up problem (which kind-of nearly fits
> the subject line): I was actually trying to get more than one of these
> hotspots onto the image, something like this:
> 
> (defun image-wipe-and-insert-two-maps ()
>   (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!"))
> 						((rect . ((51 . 51) . (100 . 100))) aSecondAreaID (pointer hand help-echo "You found another area!")))
> 					 ;; :relief -20
> 					 ;; :conversion laplace
> 					 :margin (0 . 0)
> 					 :pointer arrow)))))))
> 
> I thought this would be in accordance to the info node, where it says:
> ``An image map is an alist where each element has the format `(AREA ID
> PLIST)'." 

This variant works as you expect:

(defun image-wipe-and-insert-two-maps ()
  (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 (list
						((rect . ((0 . 0) . (50 . 50))) anAreaID (pointer hourglass help-echo "You found an area!"))
						((rect . ((51 . 51) . (100 . 100))) aSecondAreaID (pointer hand help-echo "You found another area!")))
					 ;; :relief -20
					 ;; :conversion laplace
					 :margin (0 . 0)
					 :pointer arrow)))))))

(Figuring out why you need that explicit call to 'list' is left as an
exercise ;-)




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

Previous Next


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