# HG changeset patch # User Carsten Dominik # Date 1124953567 0 # Node ID 8e982d56281bf4f1cf1a5790dc4082deb6f5bee4 # Parent 0f7c1f0c1765ee4524f2856adc3a735ebe28814d (diary-modify-entry-list-string-function): New hook. (add-to-diary-list): Call `diary-modify-entry-list-string-function' diff -r 0f7c1f0c1765 -r 8e982d56281b lisp/calendar/diary-lib.el --- a/lisp/calendar/diary-lib.el Thu Aug 25 07:05:27 2005 +0000 +++ b/lisp/calendar/diary-lib.el Thu Aug 25 07:06:07 2005 +0000 @@ -1650,6 +1650,11 @@ (or (diary-remind sexp (car days) marking) (diary-remind sexp (cdr days) marking)))))) +(defvar diary-modify-entry-list-string-function nil + "Function applied to entry string before putting it into the entries list. +This is so that program that use the emacs diary for other purposes (e.g. +planner.el and org.el) can modify the string or add properties to it.") + (defun add-to-diary-list (date string specifier &optional marker globcolor) "Add the entry (DATE STRING SPECIFIER MARKER GLOBCOLOR) to `diary-entries-list'. Do nothing if DATE or STRING is nil." @@ -1659,6 +1664,9 @@ (buffer-file-name)))) (or (string= prefix "") (setq string (format "[%s] %s" prefix string))))) + (and diary-modify-entry-list-string-function + (setq string (funcall diary-modify-entry-list-string-function + string))) (setq diary-entries-list (append diary-entries-list (list (list date string specifier marker globcolor))))))