From 619fdf3d11b1d7409645f4614b57c7205a1f0057 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Thu, 30 Nov 2000 12:27:36 +0000 Subject: (diary-entry-time): Anchor pattern correctly and skip whitespace and newlines. --- lisp/calendar/diary-lib.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lisp/calendar/diary-lib.el') diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 6439e575e4..7290280298 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -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 -- cgit v1.2.3