[-- Attachment #1.1: Type: text/plain, Size: 1239 bytes --] Hello! I am wondering whether it would be possible to introduce a new hook into org-mode. This hook would be run after any tags are added to an entry. The main use would be to check for the presence of some tag among the entry's tags, and execute some function in response to it. I suggest this because I would like to maintain a list of tags that will cause an entry to be excluded from export. I would like to do something like (setq excluded-tags '(home private bills)) (add-hook 'org-set-tag-hook 'excluded-tags '(org-set-property "PRIVATE" t)) This would automatically set the PRIVATE property of the headline to t whenever one of the members of excluded-tags was added to a headline. From there I think I could wrap the export functions to exclude all entries with a value of t for that property. I hope that, in general, the strategy of setting properties in response to the presence of certain tags will be useful. Do other folks think this would be an interesting addition? Am I overlooking an easy way to accomplish this without adding the hook to org? Thanks, /au -- Austin Frank http://aufrank.net GPG Public Key (D7398C2F): http://aufrank.net/personal.asc [-- Attachment #1.2: Type: application/pgp-signature, Size: 185 bytes --] [-- Attachment #2: Type: text/plain, Size: 204 bytes --] _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
On Sep 11, 2007, at 1:43, Austin Frank wrote:
> Hello!
>
> I am wondering whether it would be possible to introduce a new hook
> into
> org-mode. This hook would be run after any tags are added to an entry.
> The main use would be to check for the presence of some tag among the
> entry's tags, and execute some function in response to it.
The next version will have `org-after-tags-change-hook'. It will be
called
whenever the tags in an entry change, with the cursor *somewhere* on
that line.
To get a list of the tags in the current line, use (only in 5.09, right
now
this does not work correctly)
(org-get-tags)
To get the list including inherited tags, use
(org-get-tags-at (point))
- Carsten
--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477