aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2004-01-11 22:25:33 +0000
committerGlenn Morris2004-01-11 22:25:33 +0000
commit6ecab45e491dc1eacd7f43e371db316239055327 (patch)
tree8e221d03b9d315213bc0d4d5e685fc4fdadab784
parent8d638c1b96575ebf30b66a54e249ce09eac59a47 (diff)
downloademacs-6ecab45e491dc1eacd7f43e371db316239055327.tar.gz
emacs-6ecab45e491dc1eacd7f43e371db316239055327.zip
Update copyright.
(diary, diary-entry-time): Doc change. (list-diary-entries): Doc change. Trivial logic change. (fancy-diary-display): Restore make-face command mistakenly deleted 2003-05-08. (show-all-diary-entries): Allow to pop-up frame if needed.
-rw-r--r--lisp/calendar/diary-lib.el65
1 files changed, 33 insertions, 32 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 7b5ed23da7e..28fcb50ef14 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -1,6 +1,6 @@
1;;; diary-lib.el --- diary functions 1;;; diary-lib.el --- diary functions
2 2
3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003 3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003, 2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
@@ -52,8 +52,8 @@ If so, return the expanded file name, otherwise signal an error."
52(defun diary (&optional arg) 52(defun diary (&optional arg)
53 "Generate the diary window for ARG days starting with the current date. 53 "Generate the diary window for ARG days starting with the current date.
54If no argument is provided, the number of days of diary entries is governed 54If no argument is provided, the number of days of diary entries is governed
55by the variable `number-of-diary-entries'. This function is suitable for 55by the variable `number-of-diary-entries'. A value of ARG less than 1
56execution in a `.emacs' file." 56does nothing. This function is suitable for execution in a `.emacs' file."
57 (interactive "P") 57 (interactive "P")
58 (diary-check-diary-file) 58 (diary-check-diary-file)
59 (let ((date (calendar-current-date))) 59 (let ((date (calendar-current-date)))
@@ -284,7 +284,7 @@ Only used if `diary-header-line-flag' is non-nil."
284 "Create and display a buffer containing the relevant lines in diary-file. 284 "Create and display a buffer containing the relevant lines in diary-file.
285The arguments are DATE and NUMBER; the entries selected are those 285The arguments are DATE and NUMBER; the entries selected are those
286for NUMBER days starting with date DATE. The other entries are hidden 286for NUMBER days starting with date DATE. The other entries are hidden
287using selective display. 287using selective display. If NUMBER is less than 1, this function does nothing.
288 288
289Returns a list of all relevant diary entries found, if any, in order by date. 289Returns a list of all relevant diary entries found, if any, in order by date.
290The list entries have the form ((month day year) string specifier) where 290The list entries have the form ((month day year) string specifier) where
@@ -314,29 +314,29 @@ These hooks have the following distinct roles:
314 `diary-hook' is run last. This can be used for an appointment 314 `diary-hook' is run last. This can be used for an appointment
315 notification function." 315 notification function."
316 316
317 (if (< 0 number) 317 (when (> number 0)
318 (let ((original-date date);; save for possible use in the hooks 318 (let ((original-date date);; save for possible use in the hooks
319 old-diary-syntax-table 319 old-diary-syntax-table
320 diary-entries-list 320 diary-entries-list
321 file-glob-attrs 321 file-glob-attrs
322 (date-string (calendar-date-string date)) 322 (date-string (calendar-date-string date))
323 (d-file (substitute-in-file-name diary-file))) 323 (d-file (substitute-in-file-name diary-file)))
324 (message "Preparing diary...") 324 (message "Preparing diary...")
325 (save-excursion 325 (save-excursion
326 (let ((diary-buffer (find-buffer-visiting d-file))) 326 (let ((diary-buffer (find-buffer-visiting d-file)))
327 (if (not diary-buffer) 327 (if (not diary-buffer)
328 (set-buffer (find-file-noselect d-file t)) 328 (set-buffer (find-file-noselect d-file t))
329 (set-buffer diary-buffer) 329 (set-buffer diary-buffer)
330 (or (verify-visited-file-modtime diary-buffer) 330 (or (verify-visited-file-modtime diary-buffer)
331 (revert-buffer t t)))) 331 (revert-buffer t t))))
332 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil ""))) 332 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil "")))
333 (setq selective-display t) 333 (setq selective-display t)
334 (setq selective-display-ellipses nil) 334 (setq selective-display-ellipses nil)
335 (if diary-header-line-flag 335 (if diary-header-line-flag
336 (setq header-line-format diary-header-line-format)) 336 (setq header-line-format diary-header-line-format))
337 (setq old-diary-syntax-table (syntax-table)) 337 (setq old-diary-syntax-table (syntax-table))
338 (set-syntax-table diary-syntax-table) 338 (set-syntax-table diary-syntax-table)
339 (unwind-protect 339 (unwind-protect
340 (let ((buffer-read-only nil) 340 (let ((buffer-read-only nil)
341 (diary-modified (buffer-modified-p)) 341 (diary-modified (buffer-modified-p))
342 (mark (regexp-quote diary-nonmarking-symbol))) 342 (mark (regexp-quote diary-nonmarking-symbol)))
@@ -635,10 +635,10 @@ This function is provided for optional use as the `diary-display-hook'."
635 sym 635 sym
636 (symbol-name sym))) 636 (symbol-name sym)))
637 marks)))) 637 marks))))
638 faceinfo) 638 (faceinfo marks))
639 (make-face temp-face)
639 ;; Remove :face info from the marks, 640 ;; Remove :face info from the marks,
640 ;; copy the face info into temp-face 641 ;; copy the face info into temp-face
641 (setq faceinfo marks)
642 (while (setq faceinfo (memq :face faceinfo)) 642 (while (setq faceinfo (memq :face faceinfo))
643 (copy-face (read (nth 1 faceinfo)) temp-face) 643 (copy-face (read (nth 1 faceinfo)) temp-face)
644 (setcar faceinfo nil) 644 (setcar faceinfo nil)
@@ -715,7 +715,8 @@ This function gets rid of the selective display of the diary file so that
715all entries, not just some, are visible. If there is no diary buffer, one 715all entries, not just some, are visible. If there is no diary buffer, one
716is created." 716is created."
717 (interactive) 717 (interactive)
718 (let ((d-file (diary-check-diary-file))) 718 (let ((d-file (diary-check-diary-file))
719 (pop-up-frames (window-dedicated-p (selected-window))))
719 (save-excursion 720 (save-excursion
720 (set-buffer (or (find-buffer-visiting d-file) 721 (set-buffer (or (find-buffer-visiting d-file)
721 (find-file-noselect d-file t))) 722 (find-file-noselect d-file t)))
@@ -1100,8 +1101,8 @@ For example, returns 1325 for 1:25pm.
1100 1101
1101Returns `diary-unknown-time' (default value -9999) if no time is recognized. 1102Returns `diary-unknown-time' (default value -9999) if no time is recognized.
1102The recognized forms are XXXX, X:XX, or XX:XX (military time), and XXam, 1103The recognized forms are XXXX, X:XX, or XX:XX (military time), and XXam,
1103XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm, or XX:XXPM. We also try to 1104XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm, or XX:XXPM. A period (.) can
1104accept time in the form XX[.XX][am/pm/AM/PM]]." 1105be used instead of a colon (:) to separate the hour and minute parts."
1105 (let ((case-fold-search nil)) 1106 (let ((case-fold-search nil))
1106 (cond ((string-match ; Military time 1107 (cond ((string-match ; Military time
1107 "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" 1108 "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)"