forked from mirrors/org-mode
Implement tag completion of all tags in all agenda files
Add a variable org-complete-tags-always-offer-all-agenda-tags, which makes org complete all tags from all agenda files if non-nil. Usually, setting it locally to t in org-remember buffers is most convenient.
This commit is contained in:
parent
ed5513079b
commit
87fc0b0e2c
|
@ -1,3 +1,8 @@
|
|||
2009-11-30 Tassilo Horn <tassilo@member.fsf.org>
|
||||
|
||||
* org.texi (Setting tags): Document variable
|
||||
org-complete-tags-always-offer-all-agenda-tags.
|
||||
|
||||
2009-11-18 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* org.texi (Column attributes): Cross-reference special
|
||||
|
|
20
doc/org.texi
20
doc/org.texi
|
@ -4234,6 +4234,26 @@ C-c}). If you set the variable to the value @code{expert}, the special
|
|||
window is not even shown for single-key tag selection, it comes up only
|
||||
when you press an extra @kbd{C-c}.
|
||||
|
||||
@vindex org-complete-tags-always-offer-all-agenda-tags
|
||||
As said before, when setting tags and @code{org-tag-alist} is nil, then the
|
||||
list of tags in the current buffer is used. Normally, this behavior is very
|
||||
convenient, except in org remember buffers (@pxref{Remember}), because there
|
||||
are no tags that can be calculated dynamically. Here, you most probably want
|
||||
to have completion for all tags in all agenda files. This can be done by
|
||||
setting @code{org-complete-tags-always-offer-all-agenda-tags} to non-nil in
|
||||
those buffers.
|
||||
|
||||
@lisp
|
||||
(add-hook 'org-remember-mode-hook
|
||||
(lambda ()
|
||||
(set (make-local-variable
|
||||
'org-complete-tags-always-offer-all-agenda-tags)
|
||||
t)))
|
||||
@end lisp
|
||||
|
||||
Of course, you can also set it to @code{t} globally if you always want to
|
||||
have completion of all tags in all agenda files.
|
||||
|
||||
@node Tag searches, , Setting tags, Tags
|
||||
@section Tag searches
|
||||
@cindex tag searches
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2009-11-30 Tassilo Horn <tassilo@member.fsf.org>
|
||||
|
||||
* org.el (org-complete-tags-always-offer-all-agenda-tags): New
|
||||
variable.
|
||||
(org-set-tags): Use it.
|
||||
|
||||
2009-11-30 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* org-list.el (org-empty-line-terminates-plain-lists): Update
|
||||
|
|
18
lisp/org.el
18
lisp/org.el
|
@ -2426,6 +2426,20 @@ To disable these tags on a per-file basis, insert anywhere in the file:
|
|||
(const :tag "End radio group" (:endgroup))
|
||||
(const :tag "New line" (:newline)))))
|
||||
|
||||
(defcustom org-complete-tags-always-offer-all-agenda-tags nil
|
||||
"If non-nil, always offer completion for all tags of all agenda files.
|
||||
Instead of customizing this variable directly, you might want to
|
||||
set it locally for remember buffers, because there no list of
|
||||
tags in that file can be created dynamically (there are none).
|
||||
|
||||
(add-hook 'org-remember-mode-hook
|
||||
(lambda ()
|
||||
(set (make-local-variable
|
||||
'org-complete-tags-always-offer-all-agenda-tags)
|
||||
t)))"
|
||||
:group 'org-tags
|
||||
:type 'boolean)
|
||||
|
||||
(defvar org-file-tags nil
|
||||
"List of tags that can be inherited by all entries in the file.
|
||||
The tags will be inherited if the variable `org-use-tag-inheritance'
|
||||
|
@ -11684,7 +11698,9 @@ 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)))
|
||||
(or org-tag-alist (org-get-buffer-tags))
|
||||
(and org-complete-tags-always-offer-all-agenda-tags
|
||||
(org-global-tags-completion-table (org-agenda-files))))
|
||||
org-last-tags-completion-table table
|
||||
current-tags (org-split-string current ":")
|
||||
inherited-tags (nreverse
|
||||
|
|
Loading…
Reference in a new issue