changeset 34036:c2a8edb5b5ec

(diary-entry-time): Anchor pattern correctly and skip whitespace and newlines.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 30 Nov 2000 12:27:36 +0000
parents e557e0e621a5
children 38e373eb183f
files lisp/calendar/diary-lib.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/diary-lib.el	Thu Nov 30 12:17:21 2000 +0000
+++ b/lisp/calendar/diary-lib.el	Thu Nov 30 12:27:36 2000 +0000
@@ -977,19 +977,19 @@
 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 @@
 		  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