org.el (org-agenda-file-p): New predicate function.
commit54d513ee0c90f9864bbd39044d9dfbc4f1619513
authorTassilo Horn <tassilo@member.fsf.org>
Wed, 26 May 2010 02:21:55 +0000 (26 02:21 +0000)
committerJohn Wiegley <johnw@newartisans.com>
Thu, 27 May 2010 04:46:34 +0000 (26 22:46 -0600)
treede893c8f7a91bdcd7d61a7b69e9b00d979e492ba
parent6fc2ea3b9b36eeaf6f3b315cc09cbe1209468fa0
org.el (org-agenda-file-p): New predicate function.

The new function `org-agenda-file-p' checks if a given file is an org
agenda file.  Such a function is very useful in hooks, for example if
you want to export agenda files automatically when saving:

(defun th-org-mode-init ()
  ;; Update appointments and export to iCalendar when saving.
  (when (org-agenda-file-p)
    (add-hook 'after-save-hook 'th-org-agenda-to-appt t t)
    (add-hook 'after-save-hook 'org-export-icalendar-this-file t t)))
(add-hook 'org-agenda-mode-hook 'th-org-agenda-mode-init)
lisp/org.el