emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Clemens <clemens.radermacher@posteo.de>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Use completing-read-multiple for org-set-tags-command
Date: Sun, 19 Jul 2020 14:49:17 +0200	[thread overview]
Message-ID: <6afc1c4b-9846-6081-aa3e-0496226e135a@posteo.de> (raw)

[-- 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


             reply	other threads:[~2020-07-19 12:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 12:49 Clemens [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6afc1c4b-9846-6081-aa3e-0496226e135a@posteo.de \
    --to=clemens.radermacher@posteo.de \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] Use completing-read-multiple for org-set-tags-command' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).