Browse Source

Agenda: New hook for cleaning up the fancy diary buffer

Carsten Dominik 16 years ago
parent
commit
db2d759979
2 changed files with 8 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 5 1
      lisp/org-agenda.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-04-02  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-agenda.el (org-agenda-cleanup-fancy-diary-hook): New hook.
+	(org-agenda-cleanup-fancy-diary): Call the new hook.
+
 	* org-remember.el (org-remember-apply-template): Take the default
 	for the annotation from the :annotation property.
 

+ 5 - 1
lisp/org-agenda.el

@@ -3370,6 +3370,9 @@ MATCH is being ignored."
 		 'type "diary" 'date date))
 	     entries)))))
 
+(defvar org-agenda-cleanup-fancy-diary-hook nil
+  "Hook run when the fancy diary buffer is cleaned up.")
+
 (defun org-agenda-cleanup-fancy-diary ()
   "Remove unwanted stuff in buffer created by `fancy-diary-display'.
 This gets rid of the date, the underline under the date, and
@@ -3389,7 +3392,8 @@ date.  It also removes lines that contain only whitespace."
     (replace-match ""))
   (goto-char (point-min))
   (if (re-search-forward "^Org-mode dummy\n?" nil t)
-      (replace-match "")))
+      (replace-match ""))
+  (run-hooks 'org-agenda-cleanup-fancy-diary-hook))
 
 ;; Make sure entries from the diary have the right text properties.
 (eval-after-load "diary-lib"