]> git.eshelyaron.com Git - emacs.git/commitdiff
(diary-entry-time): Anchor pattern correctly
authorGerd Moellmann <gerd@gnu.org>
Thu, 30 Nov 2000 12:27:36 +0000 (12:27 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 30 Nov 2000 12:27:36 +0000 (12:27 +0000)
and skip whitespace and newlines.

lisp/calendar/diary-lib.el

index 6439e575e49d0e538ac360f1e57c2fb03b6110d3..7290280298b99c419e633ebf418c17b73f0dc12e 100644 (file)
@@ -977,19 +977,19 @@ XX:XX (military time), and XXam, XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm,
 or XX:XXPM."
   (let ((case-fold-search nil))
     (cond ((string-match;; Military time  
-           "^[ \t]*\\([0-9]?[0-9]\\):?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s)
+           "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\):?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s)
           (+ (* 100 (string-to-int
                      (substring s (match-beginning 1) (match-end 1))))
              (string-to-int (substring s (match-beginning 2) (match-end 2)))))
          ((string-match;; Hour only  XXam or XXpm
-           "^[ \t]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s)
+           "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s)
           (+ (* 100 (% (string-to-int
                           (substring s (match-beginning 1) (match-end 1)))
                          12))
              (if (equal ?a (downcase (aref s (match-beginning 2))))
                  0 1200)))
          ((string-match;; Hour and minute  XX:XXam or XX:XXpm
-           "^[ \t]*\\([0-9]?[0-9]\\):\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
+           "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\):\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
           (+ (* 100 (% (string-to-int
                           (substring s (match-beginning 1) (match-end 1)))
                          12))
@@ -998,6 +998,8 @@ or XX:XXPM."
                  0 1200)))
          (t diary-unknown-time))));; Unrecognizable
 
+;; Unrecognizable
+
 (defun list-sexp-diary-entries (date)
   "Add sexp entries for DATE from the diary file to `diary-entries-list'.
 Also, Make them visible in the diary file.  Returns t if any entries were