[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Wed, Dec 2, 2020 at 5:30 PM stardiviner <numbch...@gmail.com> wrote:

> The default [C-c C-q] completing tags only retrieve tags from current
> buffer locally.
>
> By this patch, will merge both buffer-local tags and user defined global
> `org-tags-alist`.
>
> This is more reasonable.
>
>
> [stardiviner]           <Hack this world!>      GPG key ID: 47C32433
> IRC(freeenode): stardiviner                     Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
From 95060ad30d2c7fd5db432b2058627ee48d1586b0 Mon Sep 17 00:00:00 2001
From: stardiviner <numbch...@gmail.com>
Date: Wed, 2 Dec 2020 17:24:29 +0800
Subject: [PATCH] org.el: Complete tags from both global and buffer local

* lisp/org.el: (org-fast-tag-selection): merge buffer local tags with
global alist of tags.
---
 lisp/org.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0e12e4b15..287b8c407 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12256,10 +12256,13 @@ (defun org-fast-tag-selection (current inherited table &optional todo-table)
 		    (condition-case nil
 			(setq tg (completing-read
 				  "Tag: "
-				  (or buffer-tags
-				      (with-current-buffer buf
-					(setq buffer-tags
-					      (org-get-buffer-tags))))))
+				  (delq nil
+					(delete-dups
+					 (append (or buffer-tags
+						     (with-current-buffer buf
+						       (setq buffer-tags
+							     (org-get-buffer-tags))))
+						 (org-global-tags-completion-table))))))
 		      (quit (setq tg "")))
 		    (when (string-match "\\S-" tg)
 		      (cl-pushnew (list tg) buffer-tags :test #'equal)
-- 
2.29.2

Reply via email to