Skip to content

Commit

Permalink
* lisp/org.el (org-set-tags-command): Put local tags on top
Browse files Browse the repository at this point in the history
  • Loading branch information
yantar92 committed Aug 6, 2022
1 parent e47bcb0 commit a0b21e3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lisp/org.el
Original file line number Diff line number Diff line change
Expand Up @@ -11465,12 +11465,18 @@ in Lisp code use `org-set-tags' instead."
(save-excursion
(org-back-to-heading)
(let* ((all-tags (org-get-tags))
(local-table (or org-current-tag-alist (org-get-buffer-tags)))
(table (setq org-last-tags-completion-table
(org--tag-add-to-alist
(and org-complete-tags-always-offer-all-agenda-tags
(org-global-tags-completion-table
(org-agenda-files)))
(or org-current-tag-alist (org-get-buffer-tags)))))
(append
;; Put local tags in front.
local-table
(cl-set-difference
(org--tag-add-to-alist
(and org-complete-tags-always-offer-all-agenda-tags
(org-global-tags-completion-table
(org-agenda-files)))
local-table)
local-table))))
(current-tags
(cl-remove-if (lambda (tag) (get-text-property 0 'inherited tag))
all-tags))
Expand Down

0 comments on commit a0b21e3

Please sign in to comment.