emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Include all tags from all files in completion if org-tag-alist contains :all
@ 2009-11-29 20:54 Tassilo Horn
  0 siblings, 0 replies; only message in thread
From: Tassilo Horn @ 2009-11-29 20:54 UTC (permalink / raw)
  To: emacs-orgmode; +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  <tassilo@member.fsf.org>
+
+	* 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  <carsten.dominik@gmail.com>
 
 	* 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  <tassilo@member.fsf.org>
+
+	* 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  <carsten.dominik@gmail.com>
 
 	* 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-29 20:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-29 20:54 [PATCH] Include all tags from all files in completion if org-tag-alist contains :all Tassilo Horn

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).