Browse Source

org.el: Fix the contextual check against a function

* org.el (org-contextualize-validate-key): Fix the check
against a function.
Bastien Guerry 7 years ago
parent
commit
bfe3e2102f
1 changed files with 11 additions and 11 deletions
  1. 11 11
      lisp/org.el

+ 11 - 11
lisp/org.el

@@ -8675,17 +8675,17 @@ definitions."
        (lambda (rr)
 	 (when
 	  (and (equal key (car r))
-	       (or (and (eq (car rr) 'in-file)
-			(buffer-file-name)
-			(string-match (cdr rr) (buffer-file-name)))
-		   (and (eq (car rr) 'in-mode)
-			(string-match (cdr rr) (symbol-name major-mode)))
-		   (when (and (eq (car rr) 'not-in-file)
-			      (buffer-file-name))
-		     (not (string-match (cdr rr) (buffer-file-name))))
-		   (when (eq (car rr) 'not-in-mode)
-		     (not (string-match (cdr rr) (symbol-name major-mode))))
-		   (when (functionp rr) (funcall rr))))
+	       (if (functionp rr) (funcall rr)
+		 (or (and (eq (car rr) 'in-file)
+			  (buffer-file-name)
+			  (string-match (cdr rr) (buffer-file-name)))
+		     (and (eq (car rr) 'in-mode)
+			  (string-match (cdr rr) (symbol-name major-mode)))
+		     (when (and (eq (car rr) 'not-in-file)
+				(buffer-file-name))
+		       (not (string-match (cdr rr) (buffer-file-name))))
+		     (when (eq (car rr) 'not-in-mode)
+		       (not (string-match (cdr rr) (symbol-name major-mode)))))))
 	  (push r res)))
        (car (last r))))
     (delete-dups (delq nil res))))