From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WHFmOUSCMmHeRQAAgWs5BA (envelope-from ) for ; Fri, 03 Sep 2021 22:15:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0KfLNESCMmGyMQAAB5/wlQ (envelope-from ) for ; Fri, 03 Sep 2021 20:15:00 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 06E18865E for ; Fri, 3 Sep 2021 22:15:00 +0200 (CEST) Received: from localhost ([::1]:59804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMFaT-00039X-Li for larch@yhetil.org; Fri, 03 Sep 2021 16:14:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMFAb-0000rk-Fc for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 15:48:13 -0400 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]:40591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMFAZ-0007je-N5 for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 15:48:13 -0400 Received: by mail-qv1-xf35.google.com with SMTP id 93so293189qva.7 for ; Fri, 03 Sep 2021 12:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=+Mbnf2v39xT8Xt012zlrUgeADLQLmcx4lRZ//K8HJo4=; b=gMZ7eEusN67nZ8QsoRpPIAVtOR4oDJe2dWvmBhbtiEY8hgEwX3rDPu32zMrJ+nQXTG YWgbD6ZjFpREWZJZufgmc4leBfxA9t26qldejOJFIKagkiXh4TYFhcH/j8x0INIx3tRo OBKA/Ch+4Qr2sNb+Hm+fJtNy1E7JmnOkaMTEnZ3fFQY854nKftoTYymn5u7CWuws9OEs JUshYr+c1WVR/C5bqs+83FVRMK8SxkzhwzxPIeFOXL3gIUr5ml+LuUSfNR4KZXGLRQCV 07us/KjbkkEXx58RDnZpDTmiW8RYEL9CL90HMs31kGBndVu45dCRMhHIDqouYnP3G56Y iqcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=+Mbnf2v39xT8Xt012zlrUgeADLQLmcx4lRZ//K8HJo4=; b=cLkm4FXzp0NfVUCMUT3gCCQ6S32LjH70uFM/Nxa6m3CvtznUaHI5ji6cI9GiC2VL8F otK+s2z5lkiIGmrGH8Uf8YQAUdTGE1D3iS/yiDhLOQH/85ZJTRgSsdKJihvW50hJFSuO oyROfnUcU1JDaVmPbjpdpmpErlpH7IGvHzIFjXikzizNA8+xswdlZ26OExLLesrX/VzL yBLtS4Ev7/999ODXOdFJCSbTjFSEdpCy9xK+PjQOPo21mip0qBayAxuaaTxL5VZt8zPg JdiKFgu3p/ZJyfvEgylBs/V0Kiej2IX2Z+HLteEwnnzXLhvCkYPBHfmWczUYOSZ+Us5w m9oA== X-Gm-Message-State: AOAM533+5D/j0W1cWXAAPzXkD6GWQQ541nYhwLdQVL6UQQHGyjo5lbKj 2Ax0fnYm+4/V+hd29s3GKalNSVNgOvw= X-Google-Smtp-Source: ABdhPJzFYYazqyENv1TIhGSh06M+W7Ptiu1+3z+Cmv/fON+parJqbMY+q1ht0PS7T1LY1ILqG8cE6w== X-Received: by 2002:a0c:e803:: with SMTP id y3mr746361qvn.39.1630698490343; Fri, 03 Sep 2021 12:48:10 -0700 (PDT) Received: from nbook ([2601:82:c200:166d:2866:4a5e:aa1f:64c5]) by smtp.gmail.com with ESMTPSA id w20sm104696qkj.116.2021.09.03.12.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 12:48:09 -0700 (PDT) References: <87a6l4b0bx.fsf@gmail.com> <80pmtqp2wx.fsf@felesatra.moe> <87ilzhjwkk.fsf@gmail.com> User-agent: mu4e 1.6.4; emacs 28.0.50 From: No Wayman To: Allen Li Subject: Re: [BUG] [BUG] inconsistent behavior when reading multiple tags [9.4.6 (9.4.6-g366444 @ /home/n/.emacs.d/straight/build/org/)] Date: Fri, 03 Sep 2021 15:42:04 -0400 In-reply-to: <87ilzhjwkk.fsf@gmail.com> Message-ID: <87mtotcuf5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qv1-xf35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630700100; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+Mbnf2v39xT8Xt012zlrUgeADLQLmcx4lRZ//K8HJo4=; b=ZhBbVrOZaEbATw+2VeYoXu+C6jBdKooliCmfTxh3YVOo5OXJu0OoO+qXsnWsog59OaD0V2 tNyG+yChct+1nlHUxepyvqKjpIrJDvL8JbPOdamkcKqr/g74Wlxp0IK6g/xMIclpx7C7e0 Be2RnpAloDxTjmHfaX/gpAM7J38iIwUBcnYJGwoALtT1LKs6fobA490XvR0xtmrX+k6ZLb uyEQp6x1WO/hIVtAZXUpNdfiQc1jRutIYLSsHzeBT069qdVUL5aNvqafMaP8HQTa0u7HJe 1QNIlsacVcbwU1v6eJnUnfLMuHjFlt2chHQ8pKdRftBq4HaJN5G3kDY8HGiiHg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630700100; a=rsa-sha256; cv=none; b=m4FuKO141xm57bdUbltfy1oKg8m1shLZOeStRDaFiu0AS2MmdP5rUrPlgIrdvaPBZe3zp8 2xDrceSR1CQ2VJVjkXIk3lSBweWondzQ28gOD9O6p6cPmn7OIgVM6UmoxwXSrn91NbwFl/ vkaeyUB22stJ0HV5cr8/BQSgvPMjxXSzJcaSwQ5dJ2Y6q5s2mG4G/KcwjUvueJ9ysaeNU5 qe1USFS/mr/NA5rQmGFBHrxhZLgblAx4/TWGPEARrAgZve/iq1XFDkC7kuu2a855NWw4+J roz4XzzYbF1TaVpPDrOgUOt6u7QBNApJC4nDkH7w83VE/BHKsej9PeR5tMwsWw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gMZ7eEus; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gMZ7eEus; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 06E18865E X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: RfUaOPIr/eN8 --=-=-= Content-Type: text/plain; format=flowed No Wayman writes: > See the attached patch for a first draft implementation. Attached is a second draft which compiles cleanly and makes use of mapconcat where appropriate. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-org-tags-crm-separators.patch Content-Description: org-tags-crm-separators-2 >From 079f116f6bedcf2c2b1d08c18d71d8e432d94d38 Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Fri, 3 Sep 2021 14:50:48 -0400 Subject: [PATCH] Add org-tags-crm-separators commit message/formatting pending discussion of solution. --- lisp/org-capture.el | 7 +++++-- lisp/org.el | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index c51744680..e51d039d5 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1740,9 +1740,12 @@ The template may still contain \"%?\" for cursor positioning." (org-add-colon-after-tag-completion t) (ins (mapconcat #'identity - (let ((crm-separator "[ \t]*:[ \t]*")) + (let* ((separators (or org-tags-crm-separators '(?: ?,))) + (crm-separator (org-tags-crm-regexp separators))) (completing-read-multiple - (if prompt (concat prompt ": ") "Tags: ") + (if prompt (concat prompt ": ") + (format "Tags (%s to delimit): " + (mapconcat #'char-to-string separators " "))) org-last-tags-completion-table nil nil nil 'org-tags-history)) ":"))) diff --git a/lisp/org.el b/lisp/org.el index ce68f4692..4cd173c99 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -2980,6 +2980,11 @@ is better to limit inheritance to certain tags using the variables (const :tag "Reverse alphabetical" org-string-collate-greaterp) (function :tag "Custom function" nil))) +(defcustom org-tags-crm-separators '(?: ?,) + "List of tag delimiting characters used when reading multiple tags." + :type 'list + :group 'org-tags) + (defvar org-tags-history nil "History of minibuffer reads for tags.") (defvar org-last-tags-completion-table nil @@ -12007,6 +12012,10 @@ tags." ;; it now points to BLANK-START. Use COLUMN instead. (if in-blank? (org-move-to-column column) (goto-char origin)))))) +(defun org-tags-crm-regexp (chars) + "Return `crm-separator' regexp using CHARS as separators." + (format "[ \t]*%s[ \t]*" (regexp-opt (mapcar #'char-to-string chars)))) + (defun org-set-tags-command (&optional arg) "Set the tags for the current visible entry. @@ -12065,11 +12074,13 @@ in Lisp code use `org-set-tags' instead." inherited-tags table (and org-fast-tag-selection-include-todo org-todo-key-alist)) - (let ((org-add-colon-after-tag-completion (< 1 (length table))) - (crm-separator "[ \t]*:[ \t]*")) + (let* ((org-add-colon-after-tag-completion (< 1 (length table))) + (separators (or org-tags-crm-separators '(?: ?,))) + (crm-separator (org-tags-crm-regexp separators))) (mapconcat #'identity (completing-read-multiple - "Tags: " + (format "Tags (%s to delimit): " + (mapconcat #'char-to-string separators " ")) org-last-tags-completion-table nil nil (org-make-tag-string current-tags) 'org-tags-history) -- 2.33.0 --=-=-=--