aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2001-10-05 15:53:02 +0000
committerSam Steingold2001-10-05 15:53:02 +0000
commit4dd618ff50cecf9666cbafb349710578812b630c (patch)
treef88348a37dd698883f7f1c04274061420cac847a
parenta01b78312abcb6cfc8ed0211d9640284e2f4da2a (diff)
downloademacs-4dd618ff50cecf9666cbafb349710578812b630c.tar.gz
emacs-4dd618ff50cecf9666cbafb349710578812b630c.zip
(diary-entry-compare): When times are identical, compare the entries
lexicographically.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/calendar/diary-lib.el31
2 files changed, 24 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2f14ba531f5..0140a33291b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12001-10-05 Sam Steingold <sds@gnu.org>
2
3 * calendar/diary-lib.el (diary-entry-compare): When times are
4 identical, compare the entries lexicographically.
5
12001-10-06 Miles Bader <miles@gnu.org> 62001-10-06 Miles Bader <miles@gnu.org>
2 7
3 * rfn-eshadow.el (rfn-eshadow-update-overlay): Use 8 * rfn-eshadow.el (rfn-eshadow-update-overlay): Use
@@ -17,12 +22,12 @@
17 `off' and used nil to mean `unspecified'. Remove `unspecified' 22 `off' and used nil to mean `unspecified'. Remove `unspecified'
18 choices from all attributes (unspecified is handled by the parent 23 choices from all attributes (unspecified is handled by the parent
19 checklist). 24 checklist).
20 * cus-edit.el (custom-face-edit-convert-widget) 25 * cus-edit.el (custom-face-edit-convert-widget)
21 (custom-face-edit-deactivate, custom-face-edit-activate) 26 (custom-face-edit-deactivate, custom-face-edit-activate)
22 (custom-face-edit-delete, custom-face-edit-attribute-tag): 27 (custom-face-edit-delete, custom-face-edit-attribute-tag):
23 New functions. 28 New functions.
24 (custom-face-edit): Specify a custom :convert-widget. 29 (custom-face-edit): Specify a custom :convert-widget.
25 (custom-pre-filter-face-spec, custom-post-filter-face-spec): 30 (custom-pre-filter-face-spec, custom-post-filter-face-spec):
26 Don't pass in default filters that map between `nil' and `off' and 31 Don't pass in default filters that map between `nil' and `off' and
27 `unspecified' and `nil'. 32 `unspecified' and `nil'.
28 33
@@ -54,7 +59,7 @@
54 (minibuffer-contents-no-properties, delete-minibuffer-contents): 59 (minibuffer-contents-no-properties, delete-minibuffer-contents):
55 Functions removed (now subrs). 60 Functions removed (now subrs).
56 (minibuffer-prompt-width): Use `minibuffer-prompt-end'. 61 (minibuffer-prompt-width): Use `minibuffer-prompt-end'.
57 62
58 * minibuf-eldef.el (minibuf-eldef-setup-minibuffer) 63 * minibuf-eldef.el (minibuf-eldef-setup-minibuffer)
59 (minibuf-eldef-update-minibuffer): Use `minibuffer-' functions 64 (minibuf-eldef-update-minibuffer): Use `minibuffer-' functions
60 instead of calling `field-' functions directly. 65 instead of calling `field-' functions directly.
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 9d3449b8019..58c9ccf5c81 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -331,7 +331,7 @@ These hooks have the following distinct roles:
331 (setq d (cdr d))) 331 (setq d (cdr d)))
332 (or entry-found 332 (or entry-found
333 (not diary-list-include-blanks) 333 (not diary-list-include-blanks)
334 (setq diary-entries-list 334 (setq diary-entries-list
335 (append diary-entries-list 335 (append diary-entries-list
336 (list (list date "" ""))))) 336 (list (list date "" "")))))
337 (setq date 337 (setq date
@@ -597,7 +597,7 @@ is created."
597 597
598 598
599 599
600(defcustom diary-mail-addr 600(defcustom diary-mail-addr
601 (if (boundp 'user-mail-address) user-mail-address nil) 601 (if (boundp 'user-mail-address) user-mail-address nil)
602 "*Email address that `diary-mail-entries' will send email to." 602 "*Email address that `diary-mail-entries' will send email to."
603 :group 'diary 603 :group 'diary
@@ -626,7 +626,7 @@ emacs -batch \\
626-eval \"(setq diary-mail-days 3 \\ 626-eval \"(setq diary-mail-days 3 \\
627 european-calendar-style t \\ 627 european-calendar-style t \\
628 diary-mail-addr \\\"user@host.name\\\" )\" \\ 628 diary-mail-addr \\\"user@host.name\\\" )\" \\
629-l diary-lib -f diary-mail-entries 629-l diary-lib -f diary-mail-entries
630at -f diary-rem.sh 0200 tomorrow 630at -f diary-rem.sh 0200 tomorrow
631 631
632You may have to tweak the syntax of the `at' command to suit your 632You may have to tweak the syntax of the `at' command to suit your
@@ -947,8 +947,11 @@ A value of 0 in any position of the pattern is a wildcard."
947 "Returns t if E1 is earlier than E2." 947 "Returns t if E1 is earlier than E2."
948 (or (calendar-date-compare e1 e2) 948 (or (calendar-date-compare e1 e2)
949 (and (calendar-date-equal (car e1) (car e2)) 949 (and (calendar-date-equal (car e1) (car e2))
950 (< (diary-entry-time (car (cdr e1))) 950 (let* ((ts1 (cadr e1)) (t1 (diary-entry-time ts1))
951 (diary-entry-time (car (cdr e2))))))) 951 (ts2 (cadr e2)) (t2 (diary-entry-time ts2)))
952 (or (< t1 t2)
953 (and (= t1 t2)
954 (string-lessp ts1 ts2)))))))
952 955
953(defcustom diary-unknown-time 956(defcustom diary-unknown-time
954 -9999 957 -9999
@@ -959,7 +962,7 @@ after those with times."
959 :type 'integer 962 :type 'integer
960 :group 'diary 963 :group 'diary
961 :version "20.3") 964 :version "20.3")
962 965
963(defun diary-entry-time (s) 966(defun diary-entry-time (s)
964 "Time at the beginning of the string S in a military-style integer. For 967 "Time at the beginning of the string S in a military-style integer. For
965example, returns 1325 for 1:25pm. Returns `diary-unknown-time' (default value 968example, returns 1325 for 1:25pm. Returns `diary-unknown-time' (default value
@@ -967,19 +970,19 @@ example, returns 1325 for 1:25pm. Returns `diary-unknown-time' (default value
967XX:XX (military time), and XXam, XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm, 970XX:XX (military time), and XXam, XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm,
968or XX:XXPM." 971or XX:XXPM."
969 (let ((case-fold-search nil)) 972 (let ((case-fold-search nil))
970 (cond ((string-match;; Military time 973 (cond ((string-match ; Military time
971 "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\):?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s) 974 "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\):?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s)
972 (+ (* 100 (string-to-int 975 (+ (* 100 (string-to-int
973 (substring s (match-beginning 1) (match-end 1)))) 976 (substring s (match-beginning 1) (match-end 1))))
974 (string-to-int (substring s (match-beginning 2) (match-end 2))))) 977 (string-to-int (substring s (match-beginning 2) (match-end 2)))))
975 ((string-match;; Hour only XXam or XXpm 978 ((string-match ; Hour only XXam or XXpm
976 "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s) 979 "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s)
977 (+ (* 100 (% (string-to-int 980 (+ (* 100 (% (string-to-int
978 (substring s (match-beginning 1) (match-end 1))) 981 (substring s (match-beginning 1) (match-end 1)))
979 12)) 982 12))
980 (if (equal ?a (downcase (aref s (match-beginning 2)))) 983 (if (equal ?a (downcase (aref s (match-beginning 2))))
981 0 1200))) 984 0 1200)))
982 ((string-match;; Hour and minute XX:XXam or XX:XXpm 985 ((string-match ; Hour and minute XX:XXam or XX:XXpm
983 "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\):\\([0-9][0-9]\\)\\([ap]\\)m\\>" s) 986 "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\):\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
984 (+ (* 100 (% (string-to-int 987 (+ (* 100 (% (string-to-int
985 (substring s (match-beginning 1) (match-end 1))) 988 (substring s (match-beginning 1) (match-end 1)))
@@ -987,9 +990,7 @@ or XX:XXPM."
987 (string-to-int (substring s (match-beginning 2) (match-end 2))) 990 (string-to-int (substring s (match-beginning 2) (match-end 2)))
988 (if (equal ?a (downcase (aref s (match-beginning 3)))) 991 (if (equal ?a (downcase (aref s (match-beginning 3))))
989 0 1200))) 992 0 1200)))
990 (t diary-unknown-time))));; Unrecognizable 993 (t diary-unknown-time)))) ; Unrecognizable
991
992;; Unrecognizable
993 994
994(defun list-sexp-diary-entries (date) 995(defun list-sexp-diary-entries (date)
995 "Add sexp entries for DATE from the diary file to `diary-entries-list'. 996 "Add sexp entries for DATE from the diary file to `diary-entries-list'.
@@ -1126,7 +1127,7 @@ A number of built-in functions are available for this type of diary entry:
1126 will appear on the proper Hebrew-date anniversary and on the 1127 will appear on the proper Hebrew-date anniversary and on the
1127 day before. (If `european-calendar-style' is t, the order 1128 day before. (If `european-calendar-style' is t, the order
1128 of the parameters should be changed to DAY, MONTH, YEAR.) 1129 of the parameters should be changed to DAY, MONTH, YEAR.)
1129 1130
1130 %%(diary-rosh-hodesh) 1131 %%(diary-rosh-hodesh)
1131 Diary entries will be made on the dates of Rosh Hodesh on 1132 Diary entries will be made on the dates of Rosh Hodesh on
1132 the Hebrew calendar. Note that since there is no text, it 1133 the Hebrew calendar. Note that since there is no text, it
@@ -1382,7 +1383,7 @@ appropriate."
1382 diary-entry) 1383 diary-entry)
1383 "*Pseudo-pattern giving form of reminder messages in the fancy diary 1384 "*Pseudo-pattern giving form of reminder messages in the fancy diary
1384display. 1385display.
1385 1386
1386Used by the function `diary-remind', a pseudo-pattern is a list of 1387Used by the function `diary-remind', a pseudo-pattern is a list of
1387expressions that can involve the keywords `days' (a number), `date' (a list of 1388expressions that can involve the keywords `days' (a number), `date' (a list of
1388month, day, year), and `diary-entry' (a string)." 1389month, day, year), and `diary-entry' (a string)."
@@ -1428,7 +1429,7 @@ marked on the calendar."
1428 "Add the entry (DATE STRING SPECIFIER) to `diary-entries-list'. 1429 "Add the entry (DATE STRING SPECIFIER) to `diary-entries-list'.
1429Do nothing if DATE or STRING is nil." 1430Do nothing if DATE or STRING is nil."
1430 (and date string 1431 (and date string
1431 (setq diary-entries-list 1432 (setq diary-entries-list
1432 (append diary-entries-list (list (list date string specifier)))))) 1433 (append diary-entries-list (list (list date string specifier))))))
1433 1434
1434(defun make-diary-entry (string &optional nonmarking file) 1435(defun make-diary-entry (string &optional nonmarking file)