From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [Bug] org-global-tags-completion-table does not include tags from buffers Date: Sun, 18 Mar 2018 18:14:05 -0500 Message-ID: <87zi35geo2.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exhVF-00059q-P7 for emacs-orgmode@gnu.org; Sun, 18 Mar 2018 19:14:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exhVC-0008MG-Hc for emacs-orgmode@gnu.org; Sun, 18 Mar 2018 19:14:13 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:49239) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exhVC-0008I9-9Y for emacs-orgmode@gnu.org; Sun, 18 Mar 2018 19:14:10 -0400 Received: from archair (c-73-246-123-194.hsd1.il.comcast.net [73.246.123.194]) by mail.messagingengine.com (Postfix) with ESMTPA id 9331324140 for ; Sun, 18 Mar 2018 19:14:06 -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 If org-tags-alist is customized by the user, the value returned by org-global-tags-completion-table does not include any tags from agenda buffers and files. This behavior contradicts the docstring of org-global-tags-completion-table, which claims to return the list of all tags in all agenda buffer/files. I believe this bug was introduced with commit 4743d43dd8e448b6c440b1e4988bcd353de60cc7 in April 2016. Before that commit, Org mode appended tags in org-tags-alist to tags gathered from the buffer. After the commit, Org mode no longer gathers buffer tags if org-tags-alist is defined. Line 13731 is the key line: (or org-current-tag-alist (org-get-buffer-tags))) AFAICT, org-current-tag-alist only includes tags defined in org-tag-alist and org-tag-persistent-alist. So if these are defined, the function will never gather the buffer tags. As an aside, this bug makes filtering the agenda by filetags or tags in org buffers impossible due to commit 404ac42ee51f0ac0d9cfb8fbefaefbbe96c61017, which requires a match for tag completion when hitting "/ [TAB]" in the agenda. Since org-global-tags-completion-table does not actually return the tags in buffers, it is impossible to filter by them. I can reproduce this with emacs -Q (emacs 25.3 and Org mode from git). Best, Matt