情况如下:我需要检索点边界下的人脸,但如果我使用高亮当前行模式,则该人脸会覆盖我感兴趣的人脸。
face-at-point
或者(get-char-property (point) 'face)
只会给我列表中的第一张脸,它将是当前行叠加层中的一张。如何获得底层面孔?
编辑:
这或多或少是我最终做的:
(defun haxe-face-at-point ()
"This is like `face-at-point' except we will only look for faces
which are relevant to haxe-mode. This will also look under overlays
created by minor modes like ispel or highlight current line."
(interactive)
(let ((props (text-properties-at (point))))
(catch 't
(while props
(when (eql (car props) 'face)
(throw 't
(when (member (cadr props)
'(font-lock-string-face
font-lock-keyword-face
font-lock-variable-name-face
font-lock-comment-face
font-lock-preprocessor-face
font-lock-type-face
default))
(cadr props))))
(setq props (cdr props))))))
我只需要找出是否有列表之一。