diff --git a/lisp/org-faces.el b/lisp/org-faces.el index d78b606ec..fc834f37d 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -291,7 +291,15 @@ determines if it is a foreground or a background color." (string :tag "Keyword") (choice :tag "Face " (string :tag "Color") - (sexp :tag "Face"))))) + (sexp :tag "Face")))) + :safe (lambda (x) + (cl-every + (lambda (pair) + (let ((keyword (car pair)) + (face (cdr pair))) + (and (stringp keyword) + (or (facep face) (listp face))))) + x))) (defface org-priority '((t :inherit font-lock-keyword-face)) "Face used for priority cookies." diff --git a/lisp/org.el b/lisp/org.el index e577dc661..da38beb45 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1945,7 +1945,13 @@ taken from the (otherwise obsolete) variable `org-todo-interpretation'." org-todo-interpretation-widgets)) widget)) (repeat - (string :tag "Keyword")))))) + (string :tag "Keyword"))))) + :safe (lambda (x) + (cl-every + (lambda (seq) + (and (memq (car seq) '(sequence type)) + (cl-every (lambda (i) (stringp i)) (cdr seq)))) + x))) (defvar-local org-todo-keywords-1 nil "All TODO and DONE keywords active in a buffer.") @@ -4358,10 +4364,9 @@ related expressions." (cons 'sequence (split-string value))) (append (cdr (assoc "TODO" alist)) (cdr (assoc "SEQ_TODO" alist))))) - (let ((d (default-value 'org-todo-keywords))) - (if (not (stringp (car d))) d - ;; XXX: Backward compatibility code. - (list (cons org-todo-interpretation d))))))) + (if (not (stringp (car org-todo-keywords))) org-todo-keywords + ;; XXX: Backward compatibility code. + (list (cons org-todo-interpretation org-todo-keywords)))))) (dolist (sequence todo-sequences) (let* ((sequence (or (run-hook-with-args-until-success 'org-todo-setup-filter-hook sequence) @@ -4909,7 +4914,18 @@ The following commands are available: ;; Try to set `org-hide' face correctly. (let ((foreground (org-find-invisible-foreground))) (when foreground - (set-face-foreground 'org-hide foreground)))) + (set-face-foreground 'org-hide foreground))) + + (add-hook 'hack-local-variables-hook #'org--process-local-variables nil t)) + +(defun org--process-local-variables () + "Refresh settings affected by file-local or directory-local variables." + (when + (let ((local-vars (mapcar #'car file-local-variables-alist))) + (or (memq 'org-todo-keywords local-vars) + (memq 'org-todo-keyword-faces local-vars))) + (org-set-regexps-and-options) + (org-set-font-lock-defaults))) ;; Update `customize-package-emacs-version-alist' (add-to-list 'customize-package-emacs-version-alist