bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20508: 24.4; image map properties not working as described


From: Eli Zaretskii
Subject: bug#20508: 24.4; image map properties not working as described
Date: Tue, 05 May 2015 19:32:01 +0300

> From: pma <address@hidden>
> 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.)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]