[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] Include all tags from all files in completion if org-t

From: Tassilo Horn
Subject: [Orgmode] [PATCH] Include all tags from all files in completion if org-tag-alist contains :all
Date: Sun, 29 Nov 2009 21:54:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

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.


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  <address@hidden>
+       * 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  <address@hidden>
        * 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:
 @end example
+Additionally, you can include the keyword @code{:all} in
address@hidden, 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  <address@hidden>
+       * 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  <address@hidden>
        * 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
          (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 
+         (setq org-last-tags-completion-table table
                current-tags (org-split-string current ":")
                inherited-tags (nreverse
                                (nthcdr (length current-tags)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]