diff options
| author | Glenn Morris | 2008-03-09 03:42:20 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-09 03:42:20 +0000 |
| commit | 7e8a162967c325af3e67df53eb75de450881a901 (patch) | |
| tree | e992e4bb96b189550ddd7d0cdf932321eda059f3 | |
| parent | 32a091dd1996bd3b3f3c7ec2321c5c19e2c01642 (diff) | |
| download | emacs-7e8a162967c325af3e67df53eb75de450881a901.tar.gz emacs-7e8a162967c325af3e67df53eb75de450881a901.zip | |
(nongregorian-diary-marking-hook, list-sexp-diary-entries): Doc fixes.
(diary-list-entries): Doc fix. Remove free variable `entry'.
(fancy-diary-display): Use dolist, bobp. Remove free variable `entry'.
(mark-diary-entries): Remove free variable `entry'.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 122 |
2 files changed, 66 insertions, 65 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4d1e78eca63..90866ba21e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2008-03-09 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-03-09 Glenn Morris <rgm@gnu.org> |
| 2 | |||
| 3 | * calendar/diary-lib.el (nongregorian-diary-marking-hook) | ||
| 4 | (list-sexp-diary-entries): Doc fixes. | ||
| 5 | (diary-list-entries): Doc fix. Remove free variable `entry'. | ||
| 6 | (fancy-diary-display): Use dolist, bobp. Remove free variable `entry'. | ||
| 7 | (mark-diary-entries): Remove free variable `entry'. | ||
| 2 | 8 | ||
| 9 | 2008-03-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 3 | 10 | ||
| 4 | * bookmark.el (bookmark-make): Don't pass the `annotation' to the | 11 | * bookmark.el (bookmark-make): Don't pass the `annotation' to the |
| 5 | make-record function, instead paste it in afterwards. | 12 | make-record function, instead paste it in afterwards. |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index e84f08a475e..ff94c60d144 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -164,7 +164,7 @@ describes the style of such diary entries." | |||
| 164 | As the files are processed for diary entries, these functions are used | 164 | As the files are processed for diary entries, these functions are used |
| 165 | to cull relevant entries. You can use either or both of | 165 | to cull relevant entries. You can use either or both of |
| 166 | `mark-hebrew-diary-entries', `mark-islamic-diary-entries' and | 166 | `mark-hebrew-diary-entries', `mark-islamic-diary-entries' and |
| 167 | `mark-bahai-diary-entries'. The documentation for these functions | 167 | `bahai-mark-diary-entries'. The documentation for these functions |
| 168 | describes the style of such diary entries." | 168 | describes the style of such diary entries." |
| 169 | :type 'hook | 169 | :type 'hook |
| 170 | :options '(mark-hebrew-diary-entries | 170 | :options '(mark-hebrew-diary-entries |
| @@ -650,6 +650,8 @@ These hooks have the following distinct roles: | |||
| 650 | `diary-hook' is run last. This can be used for an appointment | 650 | `diary-hook' is run last. This can be used for an appointment |
| 651 | notification function. | 651 | notification function. |
| 652 | 652 | ||
| 653 | Functions called by these hooks may use DATE and NUMBER. | ||
| 654 | |||
| 653 | If LIST-ONLY is non-nil don't modify or display the buffer, only return a list." | 655 | If LIST-ONLY is non-nil don't modify or display the buffer, only return a list." |
| 654 | (unless number | 656 | (unless number |
| 655 | (setq number (if (vectorp number-of-diary-entries) | 657 | (setq number (if (vectorp number-of-diary-entries) |
| @@ -748,13 +750,12 @@ If LIST-ONLY is non-nil don't modify or display the buffer, only return a list." | |||
| 748 | (unless list-only | 750 | (unless list-only |
| 749 | (remove-overlays date-start (point) | 751 | (remove-overlays date-start (point) |
| 750 | 'invisible 'diary)) | 752 | 'invisible 'diary)) |
| 751 | ; FIXME free variable entry? | 753 | (setq temp (diary-pull-attrs |
| 752 | (setq entry (buffer-substring entry-start (point)) | 754 | (buffer-substring entry-start (point)) |
| 753 | temp (diary-pull-attrs entry file-glob-attrs) | 755 | file-glob-attrs)) |
| 754 | entry (nth 0 temp)) | ||
| 755 | (add-to-diary-list | 756 | (add-to-diary-list |
| 756 | date | 757 | date |
| 757 | entry | 758 | (car temp) |
| 758 | (buffer-substring | 759 | (buffer-substring |
| 759 | (1+ date-start) (1- entry-start)) | 760 | (1+ date-start) (1- entry-start)) |
| 760 | (copy-marker entry-start) (nth 1 temp))))))) | 761 | (copy-marker entry-start) (nth 1 temp))))))) |
| @@ -923,10 +924,10 @@ This function is provided for optional use as the `diary-display-hook'." | |||
| 923 | (holiday-list-last-month 1) | 924 | (holiday-list-last-month 1) |
| 924 | (holiday-list-last-year 1) | 925 | (holiday-list-last-year 1) |
| 925 | (date (list 0 0 0))) | 926 | (date (list 0 0 0))) |
| 926 | (while entry-list | 927 | (dolist (entry entry-list) |
| 927 | (if (not (calendar-date-equal date (car (car entry-list)))) | 928 | (if (not (calendar-date-equal date (car entry))) |
| 928 | (progn | 929 | (progn |
| 929 | (setq date (car (car entry-list))) | 930 | (setq date (car entry)) |
| 930 | (and holidays-in-diary-buffer | 931 | (and holidays-in-diary-buffer |
| 931 | (calendar-date-compare | 932 | (calendar-date-compare |
| 932 | (list (list holiday-list-last-month | 933 | (list (list holiday-list-last-month |
| @@ -937,8 +938,8 @@ This function is provided for optional use as the `diary-display-hook'." | |||
| 937 | (list date)) | 938 | (list date)) |
| 938 | ;; We need to get the holidays for the next 3 months. | 939 | ;; We need to get the holidays for the next 3 months. |
| 939 | (setq holiday-list-last-month | 940 | (setq holiday-list-last-month |
| 940 | (extract-calendar-month date)) | 941 | (extract-calendar-month date) |
| 941 | (setq holiday-list-last-year | 942 | holiday-list-last-year |
| 942 | (extract-calendar-year date)) | 943 | (extract-calendar-year date)) |
| 943 | (progn | 944 | (progn |
| 944 | (increment-calendar-month | 945 | (increment-calendar-month |
| @@ -960,7 +961,7 @@ This function is provided for optional use as the `diary-display-hook'." | |||
| 960 | (setq d (append d (cdr (car h))))) | 961 | (setq d (append d (cdr (car h))))) |
| 961 | (setq h (cdr h))) | 962 | (setq h (cdr h))) |
| 962 | d))) | 963 | d))) |
| 963 | (insert (if (= (point) (point-min)) "" ?\n) date-string) | 964 | (insert (if (bobp) "" ?\n) date-string) |
| 964 | (if date-holiday-list (insert ": ")) | 965 | (if date-holiday-list (insert ": ")) |
| 965 | (let* ((l (current-column)) | 966 | (let* ((l (current-column)) |
| 966 | (longest 0)) | 967 | (longest 0)) |
| @@ -971,51 +972,46 @@ This function is provided for optional use as the `diary-display-hook'." | |||
| 971 | date-holiday-list | 972 | date-holiday-list |
| 972 | (concat "\n" (make-string l ? )))) | 973 | (concat "\n" (make-string l ? )))) |
| 973 | (insert ?\n (make-string (+ l longest) ?=) ?\n))))) | 974 | (insert ?\n (make-string (+ l longest) ?=) ?\n))))) |
| 974 | 975 | (let ((this-entry (cadr entry)) | |
| 975 | ;; FIXME free variable entry? | 976 | this-loc) |
| 976 | (setq entry (car (cdr (car entry-list)))) | 977 | (unless (zerop (length this-entry)) |
| 977 | (if (< 0 (length entry)) | 978 | (if (setq this-loc (nth 3 entry)) |
| 978 | (let ((this-entry (car entry-list)) | 979 | (insert-button (concat this-entry "\n") |
| 979 | this-loc) | 980 | ;; (MARKER FILENAME SPECIFIER LITERAL) |
| 980 | (if (setq this-loc (nth 3 this-entry)) | 981 | 'locator (list (car this-loc) |
| 981 | (insert-button (concat entry "\n") | 982 | (cadr this-loc) |
| 982 | ;; (MARKER FILENAME SPECIFIER LITERAL) | 983 | (nth 2 entry) |
| 983 | 'locator (list (car this-loc) | 984 | (or (nth 2 this-loc) |
| 984 | (cadr this-loc) | 985 | (nth 1 entry))) |
| 985 | (nth 2 this-entry) | 986 | :type 'diary-entry) |
| 986 | (or (nth 2 this-loc) | 987 | (insert this-entry ?\n)) |
| 987 | (nth 1 this-entry))) | 988 | (save-excursion |
| 988 | :type 'diary-entry) | 989 | (let* ((marks (nth 4 entry)) |
| 989 | ; FIXME free variable entry? | 990 | (faceinfo marks) |
| 990 | (insert entry ?\n)) | 991 | temp-face) |
| 991 | (save-excursion | 992 | (when marks |
| 992 | (let* ((marks (nth 4 this-entry)) | 993 | (setq temp-face (make-symbol |
| 993 | (faceinfo marks) | 994 | (apply |
| 994 | temp-face) | 995 | 'concat "temp-face-" |
| 995 | (when marks | 996 | (mapcar (lambda (sym) |
| 996 | (setq temp-face (make-symbol | 997 | (if (stringp sym) |
| 997 | (apply | 998 | sym |
| 998 | 'concat "temp-face-" | 999 | (symbol-name sym))) |
| 999 | (mapcar (lambda (sym) | 1000 | marks)))) |
| 1000 | (if (stringp sym) | 1001 | (make-face temp-face) |
| 1001 | sym | 1002 | ;; Remove :face info from the marks, |
| 1002 | (symbol-name sym))) | 1003 | ;; copy the face info into temp-face |
| 1003 | marks)))) | 1004 | (while (setq faceinfo (memq :face faceinfo)) |
| 1004 | (make-face temp-face) | 1005 | (copy-face (read (nth 1 faceinfo)) temp-face) |
| 1005 | ;; Remove :face info from the marks, | 1006 | (setcar faceinfo nil) |
| 1006 | ;; copy the face info into temp-face | 1007 | (setcar (cdr faceinfo) nil)) |
| 1007 | (while (setq faceinfo (memq :face faceinfo)) | 1008 | (setq marks (delq nil marks)) |
| 1008 | (copy-face (read (nth 1 faceinfo)) temp-face) | 1009 | ;; Apply the font aspects. |
| 1009 | (setcar faceinfo nil) | 1010 | (apply 'set-face-attribute temp-face nil marks) |
| 1010 | (setcar (cdr faceinfo) nil)) | 1011 | (search-backward this-entry) |
| 1011 | (setq marks (delq nil marks)) | 1012 | (overlay-put |
| 1012 | ;; Apply the font aspects. | 1013 | (make-overlay (match-beginning 0) (match-end 0)) |
| 1013 | (apply 'set-face-attribute temp-face nil marks) | 1014 | 'face temp-face)))))))) |
| 1014 | (search-backward entry) | ||
| 1015 | (overlay-put | ||
| 1016 | (make-overlay (match-beginning 0) (match-end 0)) | ||
| 1017 | 'face temp-face)))))) | ||
| 1018 | (setq entry-list (cdr entry-list)))) | ||
| 1019 | (set-buffer-modified-p nil) | 1015 | (set-buffer-modified-p nil) |
| 1020 | (goto-char (point-min)) | 1016 | (goto-char (point-min)) |
| 1021 | (setq buffer-read-only t) | 1017 | (setq buffer-read-only t) |
| @@ -1251,12 +1247,10 @@ diary entries." | |||
| 1251 | (+ y 100) | 1247 | (+ y 100) |
| 1252 | y))) | 1248 | y))) |
| 1253 | (string-to-number y-str))))) | 1249 | (string-to-number y-str))))) |
| 1254 | (let ((tmp (diary-pull-attrs (buffer-substring-no-properties | 1250 | (setq marks (nth 1 |
| 1255 | (point) (line-end-position)) | 1251 | (diary-pull-attrs (buffer-substring-no-properties |
| 1256 | file-glob-attrs))) | 1252 | (point) (line-end-position)) |
| 1257 | ;; FIXME free variable entry. | 1253 | file-glob-attrs))) |
| 1258 | (setq entry (nth 0 tmp) | ||
| 1259 | marks (nth 1 tmp))) | ||
| 1260 | (if dd-name | 1254 | (if dd-name |
| 1261 | (mark-calendar-days-named | 1255 | (mark-calendar-days-named |
| 1262 | (cdr (assoc-string | 1256 | (cdr (assoc-string |
| @@ -1453,7 +1447,7 @@ be used instead of a colon (:) to separate the hour and minute parts." | |||
| 1453 | 1447 | ||
| 1454 | (defun list-sexp-diary-entries (date) | 1448 | (defun list-sexp-diary-entries (date) |
| 1455 | "Add sexp entries for DATE from the diary file to `diary-entries-list'. | 1449 | "Add sexp entries for DATE from the diary file to `diary-entries-list'. |
| 1456 | Also, Make them visible in the diary file. Returns t if any entries were | 1450 | Also, make them visible in the diary file. Returns t if any entries were |
| 1457 | found. | 1451 | found. |
| 1458 | 1452 | ||
| 1459 | Sexp diary entries must be prefaced by a `sexp-diary-entry-symbol' (normally | 1453 | Sexp diary entries must be prefaced by a `sexp-diary-entry-symbol' (normally |