Fix missing syntax highlighting with #+SETUPFILE

* lisp/org.el (org--setup-collect-keywords): Fix wrong argument
  order.  Avoid needless recursion.

Reported-by: Kyle Meyer <kyle@kyleam.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/92208>
This commit is contained in:
Nicolas Goaziou 2014-10-30 01:10:59 +01:00
parent 1b92b8b8fe
commit d85ce34fc5
1 changed files with 9 additions and 8 deletions

View File

@ -146,7 +146,6 @@ Stars are put in group 1 and the trimmed body in group 2.")
(declare-function org-table-edit-field "org-table" (arg)) (declare-function org-table-edit-field "org-table" (arg))
(declare-function org-table-insert-row "org-table" (&optional arg)) (declare-function org-table-insert-row "org-table" (&optional arg))
(declare-function org-table-justify-field-maybe "org-table" (&optional new)) (declare-function org-table-justify-field-maybe "org-table" (&optional new))
(declare-function org-table-set-constants "org-table" ())
(declare-function org-table-calc-current-TBLFM "org-table" (&optional arg)) (declare-function org-table-calc-current-TBLFM "org-table" (&optional arg))
(declare-function org-id-get-create "org-id" (&optional force)) (declare-function org-id-get-create "org-id" (&optional force))
(declare-function org-add-archive-files "org-archive" (files)) (declare-function org-add-archive-files "org-archive" (files))
@ -5181,16 +5180,18 @@ Return value contains the following keys: `archive', `category',
(push (list 'todo value) alist)))) (push (list 'todo value) alist))))
((equal key "SETUPFILE") ((equal key "SETUPFILE")
(unless buffer-read-only ; Do not check in Gnus messages. (unless buffer-read-only ; Do not check in Gnus messages.
(let ((f (expand-file-name (org-remove-double-quotes value)))) (let ((f (and (org-string-nw-p value)
(when (and (org-string-nw-p f) (expand-file-name
(file-readable-p f) (org-remove-double-quotes value)))))
(not (member f files))) (when (and f (file-readable-p f) (not (member f files)))
(with-temp-buffer (with-temp-buffer
(let ((org-inhibit-startup t)) (org-mode))
(insert-file-contents f) (insert-file-contents f)
(setq alist (setq alist
(org--setup-collect-keywords ;; Fake Org mode to benefit from cache
regexp alist (cons f files))))))))))))))) ;; without recurring needlessly.
(let ((major-mode 'org-mode))
(org--setup-collect-keywords
regexp (cons f files) alist)))))))))))))))
alist) alist)
(defun org--setup-process-tags (tags filetags) (defun org--setup-process-tags (tags filetags)