unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: patrick mc allister <pma@rdorte.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 20508@debbugs.gnu.org
Subject: bug#20508: 24.4; image map properties not working as described
Date: Tue, 5 May 2015 19:27:54 +0200	[thread overview]
Message-ID: <20150505172753.GC18015@rdorte.org> (raw)
In-Reply-To: <83bnhzrnni.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2918 bytes --]

On Tue, May 05, 2015 at 07:32:01PM +0300, Eli Zaretskii wrote:
>
> 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.)

Thanks a lot, indeed I missed that point!

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)'." 

But my attempt to insert two of those elements leads to no :map
properties being shown for the image.

They are there, though:

(with-current-buffer "*an image area test buffer*"
  (pp (text-properties-at (point-min)) (current-buffer)))

gives me:

(rear-nonsticky
 (display)
 display
 (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!")))
	:margin
	(0 . 0)
	:pointer arrow))

-- 
patrick

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2015-05-05 17:27 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 [this message]
2015-05-05 19:14     ` Eli Zaretskii
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20150505172753.GC18015@rdorte.org \
    --to=pma@rdorte.org \
    --cc=20508@debbugs.gnu.org \
    --cc=eliz@gnu.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).