]> code.delx.au - gnu-emacs-elpa/commitdiff
wcheck-mode: make generated face predicate a lambda
authorTeemu Likonen <tlikonen@iki.fi>
Tue, 5 Jan 2016 06:24:29 +0000 (08:24 +0200)
committerTeemu Likonen <tlikonen@iki.fi>
Tue, 5 Jan 2016 07:04:09 +0000 (09:04 +0200)
packages/wcheck-mode/wcheck-mode.el

index 7ac0658cc244c37b74073035935d8a5b6be1ac67..d598f2342682af207f09ad8285b3b0068654e7d3 100644 (file)
@@ -1415,7 +1415,7 @@ areas, including invisible ones. Otherwise skip invisible text."
                                      (match-beginning 1) 'invisible buffer
                                      end)))
 
-                        ((and (eval face-p)
+                        ((and (funcall face-p)
                               (or (equal regexp-discard "")
                                   (not (string-match
                                         regexp-discard
@@ -1475,7 +1475,7 @@ text."
                            (goto-char (next-single-char-property-change
                                        (match-beginning 1) 'invisible buffer
                                        end)))
-                          ((eval face-p)
+                          ((funcall face-p)
                            ;; Make an overlay.
                            (wcheck--make-overlay
                             buffer ol-face ol-mouse-face ol-help-echo ol-keymap
@@ -1933,16 +1933,18 @@ expression will return a boolean."
          (mode (nth 1 face-settings))
          (faces (nthcdr 2 face-settings)))
     (cond ((not font-lock-mode)
-           t)
+           (lambda () t))
           ((eq mode 'read)
-           `(wcheck--face-found-p
-             ',faces (wcheck--collect-faces
-                      (match-beginning 1) (match-end 1))))
+           `(lambda ()
+              (wcheck--face-found-p
+               ',faces (wcheck--collect-faces
+                        (match-beginning 1) (match-end 1)))))
           ((eq mode 'skip)
-           `(not (wcheck--face-found-p
-                  ',faces (wcheck--collect-faces
-                           (match-beginning 1) (match-end 1)))))
-          (t t))))
+           `(lambda ()
+              (not (wcheck--face-found-p
+                    ',faces (wcheck--collect-faces
+                             (match-beginning 1) (match-end 1))))))
+          (t (lambda () t)))))
 
 
 ;;; Miscellaneous low-level functions