emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Use completing-read-multiple for org-set-tags-command
@ 2020-07-19 12:49 Clemens
  2020-07-19 14:26 ` Clemens
  2020-07-20  3:23 ` Kyle Meyer
  0 siblings, 2 replies; 11+ messages in thread
From: Clemens @ 2020-07-19 12:49 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

Hello,

Usage of org-set-tags-command can be improved by using 
completing-read-multiple so you continue to get completion after the 
first tag.

This is my first contribution to org I followed 
https://orgmode.org/worg/org-contribute.html and hope I got everything 
right.

I have signed the FSF documents (I have packages on ELPA).


     Clemens

[-- Attachment #2: 0001-org.el-Use-completing-read-multiple-for-org-set-tags.patch --]
[-- Type: text/x-patch, Size: 1403 bytes --]

From c8be9106110f266db774d73af4dcb6fbcef3bef8 Mon Sep 17 00:00:00 2001
From: Clemens Radermacher <clemera@posteo.net>
Date: Sun, 19 Jul 2020 14:30:37 +0200
Subject: [PATCH] org.el: Use `completing-read-multiple' for
 `org-set-tags-command'

* lisp/org.el (org-set-tags-command): Use `completing-read-multiple'
when prompting for tags.
---
 lisp/org.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 12a853bd6..e804ec7dd 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11877,12 +11877,16 @@ (defun org-set-tags-command (&optional arg)
 		      inherited-tags
 		      table
 		      (and org-fast-tag-selection-include-todo org-todo-key-alist))
-		   (let ((org-add-colon-after-tag-completion (< 1 (length table))))
-		     (org-trim (completing-read
-				"Tags: "
-				#'org-tags-completion-function
-				nil nil (org-make-tag-string current-tags)
-				'org-tags-history)))))))
+		   (let ((org-add-colon-after-tag-completion (< 1 (length table)))
+			 (crm-separator"[ 	]*:[ 	]*"))
+		     (org-trim
+		      (mapconcat #'identity
+				 (completing-read-multiple
+				  "Tags: "
+				  #'org-tags-completion-function
+				  nil nil (org-make-tag-string current-tags)
+				  'org-tags-history)
+				 ":")))))))
 	  (org-set-tags tags)))))
     ;; `save-excursion' may not replace the point at the right
     ;; position.
-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-07-23  4:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-19 12:49 [PATCH] Use completing-read-multiple for org-set-tags-command Clemens
2020-07-19 14:26 ` Clemens
2020-07-19 14:58   ` Clemens
2020-07-19 14:59   ` Clemens
2020-07-20  3:23 ` Kyle Meyer
2020-07-20  6:03   ` Clemens
2020-07-22  4:26     ` Kyle Meyer
2020-07-22  7:04       ` Clemens
2020-07-22  7:16       ` Clemens
2020-07-22 12:37         ` Clemens
2020-07-23  4:37           ` Kyle Meyer

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).