From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Ensure org-get-tags includes all local tags Date: Tue, 05 Jun 2018 12:39:40 -0500 Message-ID: <878t7tm8tf.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQFvu-0004rp-UY for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 13:39:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQFvr-0001UM-S9 for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 13:39:47 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33247) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQFvr-0001TT-Jt for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 13:39:43 -0400 Received: from archpad (wcnat-96-24.wheaton.edu [209.147.96.24]) by mail.messagingengine.com (Postfix) with ESMTPA id 44356E43E8 for ; Tue, 5 Jun 2018 13:39:41 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode --=-=-= Content-Type: text/plain With commit fbe56f89f75a8979e0ba48001a822518df2c66fe, the function org-get-tags incorrectly removes uninherited tags from the list of tags it returns, *even if* they are local tags. Expected behavior: org-get-tags should always return local tags, regardless of whether they are excluded from inheritance. The variable org-tags-exclude-from-inheritance should only apply to tags in parent heading or to file tags. Actual behavior: if a local tag is in org-tags-exclude-from-inheritance, org-get-tags will not return it. This causes problems with functions that call org-get-tags. For instance, if org-fast-tag-selection-single-key is set, org-set-tags-command delete all local tags that are in the list org-tags-exclude-from-inheritance. I've attached a patch that fixes the issue. Best, Matt --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Ensure-org-get-tags-returns-all-local-tags.patch >From 407c9c88f7c8629ae99fed5060ef2c428b54ebd8 Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Tue, 5 Jun 2018 12:31:42 -0500 Subject: [PATCH] Ensure org-get-tags returns all local tags * lisp/org.el: (org-get-tags) Fix a bug that removed local tags if they were in the org-tags-exclude-from-inheritance list. --- lisp/org.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index d2b4c26ff..8cfb64510 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14713,8 +14713,8 @@ Inherited tags have the `inherited' text property." (setq tags (append (mapcar #'org-add-prop-inherited (org--get-local-tags)) tags))) - (org-remove-uninherited-tags - (delete-dups (append org-file-tags tags))))))))) + (delete-dups (append (org-remove-uninherited-tags org-file-tags) + tags)))))))) (defun org-get-buffer-tags () "Get a table of all tags used in the buffer, for completion." -- 2.17.1 --=-=-=--