GNU bug report logs -
#20508
24.4; image map properties not working as described
Previous Next
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
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 10 years and 53 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.