ox: Fix "wrong type argument listp" when filtering tags

* lisp/org.el (org--setup-process-tags): Fill `org-tag-groups-alist'
  only when group tags are defined.

Reported-by: Elric Milon <emacs@whirm.eu>
<http://permalink.gmane.org/gmane.emacs.orgmode/92406>
This commit is contained in:
Nicolas Goaziou 2014-11-07 21:06:10 +01:00
parent a2f8a48ab5
commit f49833293a
1 changed files with 25 additions and 23 deletions

View File

@ -5219,29 +5219,31 @@ FILETAGS is a list of tags, as strings."
(org-set-local 'org-tag-groups-alist nil)
(org-set-local 'org-tag-alist nil)
(let (group-flag)
(dolist (e tags)
(cond
((equal e "{")
(push '(:startgroup) org-tag-alist)
(setq group-flag t))
((equal e "}")
(push '(:endgroup) org-tag-alist)
(setq group-flag nil))
((equal e ":")
(push '(:grouptags) org-tag-alist)
(setq group-flag 'append))
((equal e "\\n") (push '(:newline) org-tag-alist))
((string-match (org-re "\\`\\([[:alnum:]_@#%]+\\)\\(?:(\\(.\\))\\)?\\'")
e)
(let ((tag (match-string 1 e))
(key (and (match-beginning 2)
(string-to-char (match-string 2 e)))))
(cond ((eq group-flag 'append)
(setcar org-tag-groups-alist
(append (car org-tag-groups-alist) (list tag))))
(group-flag (push (list tag) org-tag-groups-alist)))
(unless (assoc tag org-tag-alist)
(push (cons tag key) org-tag-alist)))))))
(while tags
(let ((e (car tags)))
(setq tags (cdr tags))
(cond
((equal e "{")
(push '(:startgroup) org-tag-alist)
(when (equal (nth 1 tags) ":") (setq group-flag t)))
((equal e "}")
(push '(:endgroup) org-tag-alist)
(setq group-flag nil))
((equal e ":")
(push '(:grouptags) org-tag-alist)
(setq group-flag 'append))
((equal e "\\n") (push '(:newline) org-tag-alist))
((string-match
(org-re "\\`\\([[:alnum:]_@#%]+\\)\\(?:(\\(.\\))\\)?\\'") e)
(let ((tag (match-string 1 e))
(key (and (match-beginning 2)
(string-to-char (match-string 2 e)))))
(cond ((eq group-flag 'append)
(setcar org-tag-groups-alist
(append (car org-tag-groups-alist) (list tag))))
(group-flag (push (list tag) org-tag-groups-alist)))
(unless (assoc tag org-tag-alist)
(push (cons tag key) org-tag-alist))))))))
(setq org-tag-alist (nreverse org-tag-alist)))
(defun org-file-contents (file &optional noerror)