all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: patrick mc allister <pma@rdorte.org>
Cc: 20508@debbugs.gnu.org
Subject: bug#20508: 24.4; image map properties not working as described
Date: Tue, 05 May 2015 22:14:31 +0300	[thread overview]
Message-ID: <83zj5irg4o.fsf@gnu.org> (raw)
In-Reply-To: <20150505172753.GC18015@rdorte.org>

> Date: Tue, 5 May 2015 19:27:54 +0200
> From: patrick mc allister <pma@rdorte.org>
> Cc: 20508@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 ;-)





  reply	other threads:[~2015-05-05 19:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05  9:28 bug#20508: 24.4; image map properties not working as described pma
2015-05-05 16:32 ` Eli Zaretskii
2015-05-05 17:27   ` patrick mc allister
2015-05-05 19:14     ` Eli Zaretskii [this message]
2015-05-06  7:15       ` patrick mc allister
2015-05-06 15:24         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zj5irg4o.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=20508@debbugs.gnu.org \
    --cc=pma@rdorte.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.