aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-12 23:05:43 +0000
committerRichard M. Stallman1997-08-12 23:05:43 +0000
commit0488694c338901ddd780425741bdcab1bdf2a747 (patch)
tree0a3ec4858545f0b7c8ccc0bdd69e6da4044c1cfc
parent85c922901f4187472ebd99f2c2b26e63467bcfa2 (diff)
downloademacs-0488694c338901ddd780425741bdcab1bdf2a747.tar.gz
emacs-0488694c338901ddd780425741bdcab1bdf2a747.zip
(diary-entry-time): Bind case-fold-search to nil.
-rw-r--r--lisp/calendar/diary-lib.el43
1 files changed, 22 insertions, 21 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index b658566eeca..e002958978e 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -882,27 +882,28 @@ A value of 0 in any position of the pattern is a wildcard."
882For example, returns 1325 for 1:25pm. Returns -9999 if no time is recognized. 882For example, returns 1325 for 1:25pm. Returns -9999 if no time is recognized.
883The recognized forms are XXXX or X:XX or XX:XX (military time), XXam or XXpm, 883The recognized forms are XXXX or X:XX or XX:XX (military time), XXam or XXpm,
884and XX:XXam or XX:XXpm." 884and XX:XXam or XX:XXpm."
885 (cond ((string-match;; Military time 885 (let ((case-fold-search nil))
886 "^[ \t]*\\([0-9]?[0-9]\\):?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s) 886 (cond ((string-match;; Military time
887 (+ (* 100 (string-to-int 887 "^[ \t]*\\([0-9]?[0-9]\\):?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s)
888 (substring s (match-beginning 1) (match-end 1)))) 888 (+ (* 100 (string-to-int
889 (string-to-int (substring s (match-beginning 2) (match-end 2))))) 889 (substring s (match-beginning 1) (match-end 1))))
890 ((string-match;; Hour only XXam or XXpm 890 (string-to-int (substring s (match-beginning 2) (match-end 2)))))
891 "^[ \t]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s) 891 ((string-match;; Hour only XXam or XXpm
892 (+ (* 100 (% (string-to-int 892 "^[ \t]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s)
893 (substring s (match-beginning 1) (match-end 1))) 893 (+ (* 100 (% (string-to-int
894 12)) 894 (substring s (match-beginning 1) (match-end 1)))
895 (if (equal ?a (downcase (aref s (match-beginning 2)))) 895 12))
896 0 1200))) 896 (if (equal ?a (downcase (aref s (match-beginning 2))))
897 ((string-match;; Hour and minute XX:XXam or XX:XXpm 897 0 1200)))
898 "^[ \t]*\\([0-9]?[0-9]\\):\\([0-9][0-9]\\)\\([ap]\\)m\\>" s) 898 ((string-match;; Hour and minute XX:XXam or XX:XXpm
899 (+ (* 100 (% (string-to-int 899 "^[ \t]*\\([0-9]?[0-9]\\):\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
900 (substring s (match-beginning 1) (match-end 1))) 900 (+ (* 100 (% (string-to-int
901 12)) 901 (substring s (match-beginning 1) (match-end 1)))
902 (string-to-int (substring s (match-beginning 2) (match-end 2))) 902 12))
903 (if (equal ?a (downcase (aref s (match-beginning 3)))) 903 (string-to-int (substring s (match-beginning 2) (match-end 2)))
904 0 1200))) 904 (if (equal ?a (downcase (aref s (match-beginning 3))))
905 (t -9999)));; Unrecognizable 905 0 1200)))
906 (t -9999))));; Unrecognizable
906 907
907(defun list-sexp-diary-entries (date) 908(defun list-sexp-diary-entries (date)
908 "Add sexp entries for DATE from the diary file to `diary-entries-list'. 909 "Add sexp entries for DATE from the diary file to `diary-entries-list'.