aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/calendar
diff options
context:
space:
mode:
authorCarsten Dominik <[email protected]>2005-08-25 07:06:07 +0000
committerCarsten Dominik <[email protected]>2005-08-25 07:06:07 +0000
commit9a20c79bcec8a2b87af788711c0f60ea1247af1d (patch)
tree26cd7f72012d316a2d07c2c32ba0c01db765f0a5 /lisp/calendar
parent822fcf5b09d27b36badf2b11746504f69ed22668 (diff)
(diary-modify-entry-list-string-function): New hook.
(add-to-diary-list): Call `diary-modify-entry-list-string-function'
Diffstat (limited to 'lisp/calendar')
-rw-r--r--lisp/calendar/diary-lib.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 8b14061a95..ebcb4278ee 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -1650,6 +1650,11 @@ marked on the calendar."
(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 @@ Do nothing if DATE or STRING is nil."
(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))))))