From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id APdPJ65o/l84XQAA0tVLHw (envelope-from ) for ; Wed, 13 Jan 2021 03:27:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kR33Iq5o/l+xEwAAbx9fmQ (envelope-from ) for ; Wed, 13 Jan 2021 03:27:42 +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 20B0D940105 for ; Wed, 13 Jan 2021 03:27:42 +0000 (UTC) Received: from localhost ([::1]:48058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzWov-0004yt-06 for larch@yhetil.org; Tue, 12 Jan 2021 22:27:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzWoC-0004yk-5n for emacs-orgmode@gnu.org; Tue, 12 Jan 2021 22:26:56 -0500 Received: from out0.migadu.com ([2001:41d0:2:267::]:58350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzWo8-0006qV-4Q for emacs-orgmode@gnu.org; Tue, 12 Jan 2021 22:26:55 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1610508406; h=from:from: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; bh=RaskkUPt14u+5xguLlj9IF8wwJuitnG+jqcOkXlE1Hc=; b=pGOCnEugWQtd2QWS5xZTzlkb4WboI6OTTuQTT/20eIOy2UXqZZtBL1tQ/B67SYEl1rGUTk bIkQCcjXmJGNeiWVrjRxTImcWFksdm2aWVq2WnR2WBQ3DRdmHsa6ygbijnYh8z0ayBGmiY GuandxNyuZEyMWjbspxYXqDYDG1j4+4dFdHGX+gvZnb+8d+KbrD6uegO2OdcPOG/weiLed cK7hoaLsi60ovg5wsHVvDbb8tqj3iX6UZhgf+UQOz9zRFHmZJP9i4BltLmDIoI2vf1dhBS O23J5A+TUgq61iiwcGcgUy3BSlT7p5uEXolYdpopBj46jLiU3S/+YFFzP4kT1g== From: Kyle Meyer To: Christopher Miles Subject: Re: [PATCH] I updated patch by deleteing duplicate tags In-Reply-To: References: <87sg78phnc.fsf@kyleam.com> Message-ID: <87sg7534az.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Auth-User: kyle@kyleam.com Date: Wed, 13 Jan 2021 03:26:46 GMT Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=kyle@kyleam.com; helo=out0.migadu.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, 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: Org-mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=pGOCnEug; dmarc=none; 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: 20B0D940105 X-Spam-Score: -2.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: e83fZu4C638W Christopher Miles writes: > Kyle Meyer writes: > >> stardiviner writes: >>>> By this patch, will merge both buffer-local tags and user defined global >>>> `org-tags-alist`. >> >> It does a bit more than that. It uses org-global-tags-completion-table, >> which considers tags in all agenda files by default and takes into >> account org-tag-alist (as well as org-tag-persistent-alist) via the use >> of the org-current-tag-alist variable. > > That's what I want. Why obviously user pre-defined tags can't be used globally. > Right? It should be. My point was that it's not just adding these pre-defined lists (#1); it's also adding tags from agenda files (#2). I think we certainly don't want to do #2 unconditionally. On the other hand, #1 is probably okay, but as I said in my last email, I could see not wanting that either. Anyway, the patch I proposed (which you've adapted for your latest round), avoids #2 by guarding the behavior behind the existing org-complete-tags-always-offer-all-agenda-tags option, and I think that's a good path forward. > 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. And it obey the option > org-complete-tags-always-offer-all-agenda-tags. s/obey/&s/ > * doc/org-manual.org: Update the TAB key doc in tags selection UI. > > * etc/ORG-NEWS: Mention the change in org-set-tags-command. > --- > doc/org-manual.org | 6 +++--- > etc/ORG-NEWS | 5 +++++ > lisp/org.el | 24 ++++++++++++++---------- > 3 files changed, 22 insertions(+), 13 deletions(-) > > diff --git a/doc/org-manual.org b/doc/org-manual.org > index b015b502c..01cec4b8d 100644 > --- a/doc/org-manual.org > +++ b/doc/org-manual.org > @@ -4860,9 +4860,9 @@ In this interface, you can also use the following special keys: > > #+kindex: TAB > Enter a tag in the minibuffer, even if the tag is not in the > - predefined list. You can complete on all tags present in the > - buffer. You can also add several tags: just separate them with > - a comma. > + predefined list. You can complete on all tags present in the buffer > + and globally pre-defined tags from ~org-tag{-persistent}-alist~. Please spell these two options out: ~org-tag-alist~ and ~org-tag-persistent-alist~. > + You can also add several tags: just separate them with a comma. > > - {{{kbd(SPC)}}} :: > > diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS > index 5e5f1954d..5e68d27c0 100644 > --- a/etc/ORG-NEWS > +++ b/etc/ORG-NEWS > @@ -149,6 +149,11 @@ Example: > A new =u= mode flag for Calc formulas in Org tables has been added to > enable Calc units simplification mode. > > +*** =org-set-tags-command= select tags from ~org-global-tags-completion-table~ > + > +Let =org-set-tags-command= complete tags from global tags list (both > +buffer-local tags and ~org-tag{-persistent}-alist~). Same note about avoiding shorthand for the option names. Also, please rewrite this to make it clear that this is relevant for TAB in the fast completion interface. It's probably also worth mentioning that org-complete-tags-always-offer-all-agenda-tags is now honored. And, very minor, but any reason for the mix of =...= and ~...~ markup here? > diff --git a/lisp/org.el b/lisp/org.el > index 5b0ae389c..ba816dfa6 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -12139,7 +12139,7 @@ (defun org-fast-tag-selection (current inherited table &optional todo-table) > fulltable)))) > (buf (current-buffer)) > (expert (eq org-fast-tag-selection-single-key 'expert)) > - (buffer-tags nil) > + (tab-tags nil) > (fwidth (+ maxlen 3 1 3)) > (ncol (/ (- (window-width) 4) fwidth)) > (i-face 'org-done) > @@ -12274,16 +12274,20 @@ (defun org-fast-tag-selection (current inherited table &optional todo-table) > (setq current nil) > (when exit-after-next (setq exit-after-next 'now))) > ((= c ?\t) > - (condition-case nil Unlike the patch I sent, you've dropped the condition-case here, which I don't think was intentional. Thanks.