aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calendar/diary-lib.el113
1 files changed, 57 insertions, 56 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index a128e50a0fb..2adec8750c3 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -263,6 +263,16 @@ search."
263 (setq attr-list (cdr attr-list))))) 263 (setq attr-list (cdr attr-list)))))
264 (list entry ret-attr)))) 264 (list entry ret-attr))))
265 265
266(defun diary-set-maybe-redraw (symbol value)
267 "Set SYMBOL's value to VALUE, and redraw the diary if necessary.
268Redraws the diary if it is being displayed (note this is not the same as
269just visiting the `diary-file'), and SYMBOL's value is to be changed."
270 (let ((oldvalue (eval symbol)))
271 (custom-set-default symbol value)
272 (and (not (equal value oldvalue))
273 (diary-live-p)
274 ;; Note this assumes diary was called without prefix arg.
275 (diary))))
266 276
267;; This can be removed once the kill/yank treatment of invisible text 277;; This can be removed once the kill/yank treatment of invisible text
268;; (see etc/TODO) is fixed. -- gm 278;; (see etc/TODO) is fixed. -- gm
@@ -309,17 +319,6 @@ Only used if `diary-header-line-flag' is non-nil."
309 (and diary-file 319 (and diary-file
310 (find-buffer-visiting (substitute-in-file-name diary-file))))) 320 (find-buffer-visiting (substitute-in-file-name diary-file)))))
311 321
312(defun diary-set-maybe-redraw (symbol value)
313 "Set SYMBOL's value to VALUE, and redraw the diary if necessary.
314Redraws the diary if it is being displayed (note this is not the same as
315just visiting the `diary-file'), and SYMBOL's value is to be changed."
316 (let ((oldvalue (eval symbol)))
317 (custom-set-default symbol value)
318 (and (not (equal value oldvalue))
319 (diary-live-p)
320 ;; Note this assumes diary was called without prefix arg.
321 (diary))))
322
323(defcustom number-of-diary-entries 1 322(defcustom number-of-diary-entries 1
324 "Specifies how many days of diary entries are to be displayed initially. 323 "Specifies how many days of diary entries are to be displayed initially.
325This variable affects the diary display when the command \\[diary] is used, 324This variable affects the diary display when the command \\[diary] is used,
@@ -1996,51 +1995,53 @@ names."
1996(eval-when-compile (require 'cal-hebrew) 1995(eval-when-compile (require 'cal-hebrew)
1997 (require 'cal-islam)) 1996 (require 'cal-islam))
1998 1997
1999(defvar diary-font-lock-keywords 1998(defun diary-font-lock-keywords ()
2000 (append 1999 "Return a value for the variable `diary-font-lock-keywords'."
2001 (diary-font-lock-date-forms calendar-month-name-array 2000 (append
2002 nil calendar-month-abbrev-array) 2001 (diary-font-lock-date-forms calendar-month-name-array
2003 (when (or (memq 'mark-hebrew-diary-entries 2002 nil calendar-month-abbrev-array)
2004 nongregorian-diary-marking-hook) 2003 (when (or (memq 'mark-hebrew-diary-entries
2005 (memq 'list-hebrew-diary-entries 2004 nongregorian-diary-marking-hook)
2006 nongregorian-diary-listing-hook)) 2005 (memq 'list-hebrew-diary-entries
2007 (require 'cal-hebrew) 2006 nongregorian-diary-listing-hook))
2008 (diary-font-lock-date-forms 2007 (require 'cal-hebrew)
2009 calendar-hebrew-month-name-array-leap-year 2008 (diary-font-lock-date-forms
2010 hebrew-diary-entry-symbol)) 2009 calendar-hebrew-month-name-array-leap-year
2011 (when (or (memq 'mark-islamic-diary-entries 2010 hebrew-diary-entry-symbol))
2012 nongregorian-diary-marking-hook) 2011 (when (or (memq 'mark-islamic-diary-entries
2013 (memq 'list-islamic-diary-entries 2012 nongregorian-diary-marking-hook)
2014 nongregorian-diary-listing-hook)) 2013 (memq 'list-islamic-diary-entries
2015 (require 'cal-islam) 2014 nongregorian-diary-listing-hook))
2016 (diary-font-lock-date-forms 2015 (require 'cal-islam)
2017 calendar-islamic-month-name-array 2016 (diary-font-lock-date-forms
2018 islamic-diary-entry-symbol)) 2017 calendar-islamic-month-name-array
2019 (list 2018 islamic-diary-entry-symbol))
2020 (cons 2019 (list
2021 (concat "^" (regexp-quote diary-include-string) ".*$") 2020 (cons
2022 'font-lock-keyword-face) 2021 (concat "^" (regexp-quote diary-include-string) ".*$")
2023 (cons 2022 'font-lock-keyword-face)
2024 (concat "^" (regexp-quote diary-nonmarking-symbol) 2023 (cons
2025 "?\\(" (regexp-quote sexp-diary-entry-symbol) "\\)") 2024 (concat "^" (regexp-quote diary-nonmarking-symbol)
2026 '(1 font-lock-reference-face)) 2025 "?\\(" (regexp-quote sexp-diary-entry-symbol) "\\)")
2027 (cons 2026 '(1 font-lock-reference-face))
2028 (concat "^" (regexp-quote diary-nonmarking-symbol)) 2027 (cons
2029 'font-lock-reference-face) 2028 (concat "^" (regexp-quote diary-nonmarking-symbol))
2030 (cons 2029 'font-lock-reference-face)
2031 (concat "^" (regexp-quote diary-nonmarking-symbol) 2030 (cons
2032 "?\\(" (regexp-quote hebrew-diary-entry-symbol) "\\)") 2031 (concat "^" (regexp-quote diary-nonmarking-symbol)
2033 '(1 font-lock-reference-face)) 2032 "?\\(" (regexp-quote hebrew-diary-entry-symbol) "\\)")
2034 (cons 2033 '(1 font-lock-reference-face))
2035 (concat "^" (regexp-quote diary-nonmarking-symbol) 2034 (cons
2036 "?\\(" (regexp-quote islamic-diary-entry-symbol) "\\)") 2035 (concat "^" (regexp-quote diary-nonmarking-symbol)
2037 '(1 font-lock-reference-face)) 2036 "?\\(" (regexp-quote islamic-diary-entry-symbol) "\\)")
2038 '(diary-font-lock-sexps . font-lock-keyword-face) 2037 '(1 font-lock-reference-face))
2039 `(,(concat "\\(^\\|\\s-\\)" 2038 '(diary-font-lock-sexps . font-lock-keyword-face)
2040 diary-time-regexp "\\(-" diary-time-regexp "\\)?") 2039 `(,(concat "\\(^\\|\\s-\\)"
2041 . 'diary-time))) 2040 diary-time-regexp "\\(-" diary-time-regexp "\\)?")
2042 "Forms to highlight in `diary-mode'.") 2041 . 'diary-time))))
2043 2042
2043(defvar diary-font-lock-keywords (diary-font-lock-keywords)
2044 "Forms to highlight in `diary-mode'.")
2044 2045
2045;; Following code from Dave Love <fx@gnu.org>. 2046;; Following code from Dave Love <fx@gnu.org>.
2046;; Import Outlook-format appointments from mail messages in Gnus or 2047;; Import Outlook-format appointments from mail messages in Gnus or