comparison lisp/calendar/diary-lib.el @ 65107:8e982d56281b

(diary-modify-entry-list-string-function): New hook. (add-to-diary-list): Call `diary-modify-entry-list-string-function'
author Carsten Dominik <dominik@science.uva.nl>
date Thu, 25 Aug 2005 07:06:07 +0000
parents 18a818a2ee7c
children 3c2360bf81c4
comparison
equal deleted inserted replaced
65106:0f7c1f0c1765 65107:8e982d56281b
1648 ;; Diary entry may apply to one of a list of days before date 1648 ;; Diary entry may apply to one of a list of days before date
1649 ((and (listp days) days) 1649 ((and (listp days) days)
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."
1656 (when (and date string) 1661 (when (and date string)
1657 (if diary-file-name-prefix 1662 (if diary-file-name-prefix
1658 (let ((prefix (funcall diary-file-name-prefix-function 1663 (let ((prefix (funcall diary-file-name-prefix-function
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))))))
1665 1673
1666 (defun diary-redraw-calendar () 1674 (defun diary-redraw-calendar ()