diff options
| author | Carsten Dominik | 2005-08-25 07:06:07 +0000 |
|---|---|---|
| committer | Carsten Dominik | 2005-08-25 07:06:07 +0000 |
| commit | 9a20c79bcec8a2b87af788711c0f60ea1247af1d (patch) | |
| tree | 26cd7f72012d316a2d07c2c32ba0c01db765f0a5 | |
| parent | 822fcf5b09d27b36badf2b11746504f69ed22668 (diff) | |
| download | emacs-9a20c79bcec8a2b87af788711c0f60ea1247af1d.tar.gz emacs-9a20c79bcec8a2b87af788711c0f60ea1247af1d.zip | |
(diary-modify-entry-list-string-function): New hook.
(add-to-diary-list): Call `diary-modify-entry-list-string-function'
| -rw-r--r-- | lisp/calendar/diary-lib.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 8b14061a95b..ebcb4278ee7 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -1650,6 +1650,11 @@ marked on the calendar." | |||
| 1650 | (or (diary-remind sexp (car days) marking) | 1650 | (or (diary-remind sexp (car days) marking) |
| 1651 | (diary-remind sexp (cdr days) marking)))))) | 1651 | (diary-remind sexp (cdr days) marking)))))) |
| 1652 | 1652 | ||
| 1653 | (defvar diary-modify-entry-list-string-function nil | ||
| 1654 | "Function applied to entry string before putting it into the entries list. | ||
| 1655 | This is so that program that use the emacs diary for other purposes (e.g. | ||
| 1656 | planner.el and org.el) can modify the string or add properties to it.") | ||
| 1657 | |||
| 1653 | (defun add-to-diary-list (date string specifier &optional marker globcolor) | 1658 | (defun add-to-diary-list (date string specifier &optional marker globcolor) |
| 1654 | "Add the entry (DATE STRING SPECIFIER MARKER GLOBCOLOR) to `diary-entries-list'. | 1659 | "Add the entry (DATE STRING SPECIFIER MARKER GLOBCOLOR) to `diary-entries-list'. |
| 1655 | Do nothing if DATE or STRING is nil." | 1660 | Do nothing if DATE or STRING is nil." |
| @@ -1659,6 +1664,9 @@ Do nothing if DATE or STRING is nil." | |||
| 1659 | (buffer-file-name)))) | 1664 | (buffer-file-name)))) |
| 1660 | (or (string= prefix "") | 1665 | (or (string= prefix "") |
| 1661 | (setq string (format "[%s] %s" prefix string))))) | 1666 | (setq string (format "[%s] %s" prefix string))))) |
| 1667 | (and diary-modify-entry-list-string-function | ||
| 1668 | (setq string (funcall diary-modify-entry-list-string-function | ||
| 1669 | string))) | ||
| 1662 | (setq diary-entries-list | 1670 | (setq diary-entries-list |
| 1663 | (append diary-entries-list | 1671 | (append diary-entries-list |
| 1664 | (list (list date string specifier marker globcolor)))))) | 1672 | (list (list date string specifier marker globcolor)))))) |