How to distinguish between different overlays at point

為{幸葍}努か 提交于 2019-12-06 03:45:53

Ok, let's try to figure this out (without really knowing anything about the calendar).

(overlays-at) returns a list of overlays. I will keep this simple and only handle the first, if you want to examine all of them, simply loop over them until you find one that is suitable.

Also, the face property can be more complex than simply the name of the face, if that is the case you would need to handle that as well.

But anyway, here is a simple piece of code that (hopefully) does what you want:

(let ((overlays (overlays-at (point))))
  (if overlays
      (let ((face (overlay-get (car overlays) 'face)))
        (cond ((eq face 'lawlist-red-face)
               ;; Do something
               )
              ((eq face 'holiday)
               ;; Do another thing
               )
              (t
               ;; Do something else)))))
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!