Tags completion ignores narrowing

* lisp/org.el (org-get-buffer-tags): Ignore narrowing, if any.  Small
  refactoring.
This commit is contained in:
Nicolas Goaziou 2014-11-10 09:43:01 +01:00
parent 34bbb39454
commit 7af7edc505
1 changed files with 10 additions and 10 deletions

View File

@ -15232,16 +15232,16 @@ Returns the new tags string, or nil to not change the current settings."
(defun org-get-buffer-tags () (defun org-get-buffer-tags ()
"Get a table of all tags used in the buffer, for completion." "Get a table of all tags used in the buffer, for completion."
(let (tags) (org-with-wide-buffer
(save-excursion (goto-char (point-min))
(goto-char (point-min)) (let ((tag-re (concat org-outline-regexp-bol
(while (re-search-forward "\\(?:.*?[ \t]\\)?"
(org-re "[ \t]:\\([[:alnum:]_@#%:]+\\):[ \t\r\n]") nil t) (org-re ":\\([[:alnum:]_@#%:]+\\):[ \t]*$")))
(when (equal (char-after (point-at-bol 0)) ?*) tags)
(mapc (lambda (x) (add-to-list 'tags x)) (while (re-search-forward tag-re nil t)
(org-split-string (org-match-string-no-properties 1) ":"))))) (dolist (tag (org-split-string (org-match-string-no-properties 1) ":"))
(mapc (lambda (s) (add-to-list 'tags s)) org-file-tags) (push tag tags)))
(mapcar 'list tags))) (mapcar #'list (append org-file-tags (org-uniquify tags))))))
;;;; The mapping API ;;;; The mapping API