emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-set-tag-hook
@ 2007-09-10 23:43 Austin Frank
  2007-09-13  6:32 ` org-set-tag-hook Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Austin Frank @ 2007-09-10 23:43 UTC (permalink / raw)
  To: emacs-orgmode


[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: org-set-tag-hook
  2007-09-10 23:43 org-set-tag-hook Austin Frank
@ 2007-09-13  6:32 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2007-09-13  6:32 UTC (permalink / raw)
  To: Austin Frank; +Cc: 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-13  6:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-10 23:43 org-set-tag-hook Austin Frank
2007-09-13  6:32 ` org-set-tag-hook Carsten Dominik

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).