在图像上放置 :map 属性

Putting a :map property on an image

我正在尝试像这样在 emacs 中插入图像:

(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)))))))

这种方法有效,似乎在右上角创建了一个区域(也适用于鼠标点击)。但是 :map 属性:

我有两个问题
  1. (如何)我可以指定多个矩形吗?
  2. 额外属性 :help-echo:pointer 中的值似乎没有效果。语法错误吗?

我认为相关的信息节点在这里:info:elisp#Image Descriptors (= http://www.gnu.org/software/emacs/manual/html_node/elisp/Image-Descriptors.html)

  1. 正如它所说,图像 :map 值是 alist。您的示例使用单个元素。

  2. 正确的属性是help-echopointer(无冒号)

    (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 "icons/hicolor/128x128/apps/emacs.png"
                  :map (((rect . ((0 . 0) . (50 . 50)))
                     area1
                     (pointer hourglass
                      help-echo "You found the first area!"))
                    ((rect . ((50 . 50) . (100 . 100)))
                     area2
                     (pointer hand
                      help-echo "You found the second area!")))
                  :margin (2 . 2)
                  :pointer arrow)))))))