Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (setq rainbow-identifiers-faces-to-override (default font-lock-variable-name-face))
- (defun rainbow-identifiers-face-overridable (begin end)
- "Test if all the faces under the identifier are overridable."
- (let ((current begin)
- (contains-non-default nil))
- (catch 'rainbow-identifiers--face-overridable
- (while (progn
- (let ((face (get-text-property current 'face)))
- ; In PHP function names have no style
- (if (not (or (eq face 'default) (null face))) (setq contains-non-default t))
- (cond
- ((null face)
- t)
- ((listp face)
- (dolist (face* face)
- (unless (memq face* rainbow-identifiers-faces-to-override)
- (throw 'rainbow-identifiers--face-overridable nil))))
- (t
- (unless (memq face rainbow-identifiers-faces-to-override)
- (throw 'rainbow-identifiers--face-overridable nil)))))
- (setq current (next-single-property-change current 'face nil end))
- (not (eq current end))))
- contains-non-default)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement