emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Cc: Carsten Dominik <carsten.dominik@gmail.com>
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	[thread overview]
Message-ID: <87vdgtm4qg.fsf@thinkpad.tsdh.de> (raw)

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

                 reply	other threads:[~2009-11-29 20:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vdgtm4qg.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).