From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: [PATCH] Include all tags from all files in completion if org-tag-alist contains :all Date: Sun, 29 Nov 2009 21:54:31 +0100 Message-ID: <87vdgtm4qg.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NEqnQ-0004o6-A8 for emacs-orgmode@gnu.org; Sun, 29 Nov 2009 15:55:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NEqnK-0004nW-Du for emacs-orgmode@gnu.org; Sun, 29 Nov 2009 15:55:03 -0500 Received: from [199.232.76.173] (port=55301 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NEqnK-0004nT-4y for emacs-orgmode@gnu.org; Sun, 29 Nov 2009 15:54:58 -0500 Received: from lo.gmane.org ([80.91.229.12]:40557) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NEqnJ-0004N6-Ih for emacs-orgmode@gnu.org; Sun, 29 Nov 2009 15:54:57 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NEqnF-00040J-Sp for emacs-orgmode@gnu.org; Sun, 29 Nov 2009 21:54:53 +0100 Received: from p54af2699.dip0.t-ipconnect.de ([84.175.38.153]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 Nov 2009 21:54:53 +0100 Received: from tassilo by p54af2699.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 Nov 2009 21:54:53 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Carsten Dominik This patch add a possibility to include all tags from all agenda files in `C-c C-q'. Therefore, `org-tag-alist' may contain the keyword :all which does exactly that. --- doc/ChangeLog | 6 ++++++ doc/org.texi | 6 +++++- lisp/ChangeLog | 5 +++++ lisp/org.el | 9 +++++++-- 4 files changed, 23 insertions(+), 3 deletions(-) Hi Carsten, I was told that this is the right way to send git patches, so that you can pipe the complete mail to "git am". Subject is the summary, everything before "---" is the long description, and between "---" and the diff, text that is not recognized by git can be put. Bye, Tassilo diff --git a/doc/ChangeLog b/doc/ChangeLog index 03363fc..6b80fb7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2009-11-29 Tassilo Horn + + * org.texi (Setting tags): Document the new :all keyword that can + be used in org-tag-alist to include all tags from all agenda files + in the tag completion. + 2009-11-18 Carsten Dominik * org.texi (Column attributes): Cross-reference special diff --git a/doc/org.texi b/doc/org.texi index 1e5da22..d871cc9 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -4083,7 +4083,7 @@ When the cursor is in a headline, this does the same as @kbd{C-c C-q}. Org will support tag insertion based on a @emph{list of tags}. By default this list is constructed dynamically, containing all tags currently used in the buffer. You may also globally specify a hard list -of tags with the variable @code{org-tag-alist}. Finally you can set +of tags with the variable @code{org-tag-alist}. You can set the default tags for a given file with lines like @cindex #+TAGS @@ -4100,6 +4100,10 @@ in a specific file, add an empty TAGS option line to that file: #+TAGS: @end example +Additionally, you can include the keyword @code{:all} in +@code{org-tag-alist}, which means that you want to include all tags from all +agenda files in the completion. + @vindex org-tag-persistent-alist If you have a preferred set of tags that you would like to use in every file, in addition to those defined on a per-file basis by TAGS option lines, then diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a298452..4ee7b4c 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-11-29 Tassilo Horn + + * org.el (org-set-tags): If org-tag-alist contains the keyword + :all, include all tags from all agenda files in the completion. + 2009-11-29 Carsten Dominik * org-footnote.el (org-footnote-normalize): Protect replacement diff --git a/lisp/org.el b/lisp/org.el index b37428c..9c67eeb 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11683,8 +11683,13 @@ With prefix ARG, realign all tags in headings in the current buffer." ;; Get a new set of tags from the user (save-excursion (setq table (append org-tag-persistent-alist - (or org-tag-alist (org-get-buffer-tags))) - org-last-tags-completion-table table + (or org-tag-alist (org-get-buffer-tags)))) + ;; Keyword :all is in org-tag-alist ==> add all tags of all agenda + ;; files. + (when (member :all table) + (setq table (append (remove :all table) + (org-global-tags-completion-table (org-agenda-files))))) + (setq org-last-tags-completion-table table current-tags (org-split-string current ":") inherited-tags (nreverse (nthcdr (length current-tags) -- 1.6.5.3