Commit 6ecab45e authored by Glenn Morris's avatar Glenn Morris

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.
parent 8d638c1b
;;; diary-lib.el --- diary functions ;;; diary-lib.el --- diary functions
;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003 ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003, 2004
;; Free Software Foundation, Inc. ;; Free Software Foundation, Inc.
;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
...@@ -52,8 +52,8 @@ If so, return the expanded file name, otherwise signal an error." ...@@ -52,8 +52,8 @@ If so, return the expanded file name, otherwise signal an error."
(defun diary (&optional arg) (defun diary (&optional arg)
"Generate the diary window for ARG days starting with the current date. "Generate the diary window for ARG days starting with the current date.
If no argument is provided, the number of days of diary entries is governed If no argument is provided, the number of days of diary entries is governed
by the variable `number-of-diary-entries'. This function is suitable for by the variable `number-of-diary-entries'. A value of ARG less than 1
execution in a `.emacs' file." does nothing. This function is suitable for execution in a `.emacs' file."
(interactive "P") (interactive "P")
(diary-check-diary-file) (diary-check-diary-file)
(let ((date (calendar-current-date))) (let ((date (calendar-current-date)))
...@@ -284,7 +284,7 @@ Only used if `diary-header-line-flag' is non-nil." ...@@ -284,7 +284,7 @@ Only used if `diary-header-line-flag' is non-nil."
"Create and display a buffer containing the relevant lines in diary-file. "Create and display a buffer containing the relevant lines in diary-file.
The arguments are DATE and NUMBER; the entries selected are those The arguments are DATE and NUMBER; the entries selected are those
for NUMBER days starting with date DATE. The other entries are hidden for NUMBER days starting with date DATE. The other entries are hidden
using selective display. using selective display. If NUMBER is less than 1, this function does nothing.
Returns a list of all relevant diary entries found, if any, in order by date. Returns a list of all relevant diary entries found, if any, in order by date.
The list entries have the form ((month day year) string specifier) where The list entries have the form ((month day year) string specifier) where
...@@ -314,29 +314,29 @@ These hooks have the following distinct roles: ...@@ -314,29 +314,29 @@ These hooks have the following distinct roles:
`diary-hook' is run last. This can be used for an appointment `diary-hook' is run last. This can be used for an appointment
notification function." notification function."
(if (< 0 number) (when (> number 0)
(let ((original-date date);; save for possible use in the hooks (let ((original-date date);; save for possible use in the hooks
old-diary-syntax-table old-diary-syntax-table
diary-entries-list diary-entries-list
file-glob-attrs file-glob-attrs
(date-string (calendar-date-string date)) (date-string (calendar-date-string date))
(d-file (substitute-in-file-name diary-file))) (d-file (substitute-in-file-name diary-file)))
(message "Preparing diary...") (message "Preparing diary...")
(save-excursion (save-excursion
(let ((diary-buffer (find-buffer-visiting d-file))) (let ((diary-buffer (find-buffer-visiting d-file)))
(if (not diary-buffer) (if (not diary-buffer)
(set-buffer (find-file-noselect d-file t)) (set-buffer (find-file-noselect d-file t))
(set-buffer diary-buffer) (set-buffer diary-buffer)
(or (verify-visited-file-modtime diary-buffer) (or (verify-visited-file-modtime diary-buffer)
(revert-buffer t t)))) (revert-buffer t t))))
(setq file-glob-attrs (nth 1 (diary-pull-attrs nil ""))) (setq file-glob-attrs (nth 1 (diary-pull-attrs nil "")))
(setq selective-display t) (setq selective-display t)
(setq selective-display-ellipses nil) (setq selective-display-ellipses nil)
(if diary-header-line-flag (if diary-header-line-flag
(setq header-line-format diary-header-line-format)) (setq header-line-format diary-header-line-format))
(setq old-diary-syntax-table (syntax-table)) (setq old-diary-syntax-table (syntax-table))
(set-syntax-table diary-syntax-table) (set-syntax-table diary-syntax-table)
(unwind-protect (unwind-protect
(let ((buffer-read-only nil) (let ((buffer-read-only nil)
(diary-modified (buffer-modified-p)) (diary-modified (buffer-modified-p))
(mark (regexp-quote diary-nonmarking-symbol))) (mark (regexp-quote diary-nonmarking-symbol)))
...@@ -635,10 +635,10 @@ This function is provided for optional use as the `diary-display-hook'." ...@@ -635,10 +635,10 @@ This function is provided for optional use as the `diary-display-hook'."
sym sym
(symbol-name sym))) (symbol-name sym)))
marks)))) marks))))
faceinfo) (faceinfo marks))
(make-face temp-face)
;; Remove :face info from the marks, ;; Remove :face info from the marks,
;; copy the face info into temp-face ;; copy the face info into temp-face
(setq faceinfo marks)
(while (setq faceinfo (memq :face faceinfo)) (while (setq faceinfo (memq :face faceinfo))
(copy-face (read (nth 1 faceinfo)) temp-face) (copy-face (read (nth 1 faceinfo)) temp-face)
(setcar faceinfo nil) (setcar faceinfo nil)
...@@ -715,7 +715,8 @@ This function gets rid of the selective display of the diary file so that ...@@ -715,7 +715,8 @@ This function gets rid of the selective display of the diary file so that
all entries, not just some, are visible. If there is no diary buffer, one all entries, not just some, are visible. If there is no diary buffer, one
is created." is created."
(interactive) (interactive)
(let ((d-file (diary-check-diary-file))) (let ((d-file (diary-check-diary-file))
(pop-up-frames (window-dedicated-p (selected-window))))
(save-excursion (save-excursion
(set-buffer (or (find-buffer-visiting d-file) (set-buffer (or (find-buffer-visiting d-file)
(find-file-noselect d-file t))) (find-file-noselect d-file t)))
...@@ -1100,8 +1101,8 @@ For example, returns 1325 for 1:25pm. ...@@ -1100,8 +1101,8 @@ For example, returns 1325 for 1:25pm.
Returns `diary-unknown-time' (default value -9999) if no time is recognized. Returns `diary-unknown-time' (default value -9999) if no time is recognized.
The recognized forms are XXXX, X:XX, or XX:XX (military time), and XXam, The recognized forms are XXXX, X:XX, or XX:XX (military time), and XXam,
XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm, or XX:XXPM. We also try to XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm, or XX:XXPM. A period (.) can
accept time in the form XX[.XX][am/pm/AM/PM]]." be used instead of a colon (:) to separate the hour and minute parts."
(let ((case-fold-search nil)) (let ((case-fold-search nil))
(cond ((string-match ; Military time (cond ((string-match ; Military time
"\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment