205 |
(let (ret) |
(let (ret) |
206 |
(setq ret (cond ((eq type 'string) attrvalue) |
(setq ret (cond ((eq type 'string) attrvalue) |
207 |
((eq type 'symbol) (read attrvalue)) |
((eq type 'symbol) (read attrvalue)) |
208 |
((eq type 'int) (string-to-int attrvalue)) |
((eq type 'int) (string-to-number attrvalue)) |
209 |
((eq type 'stringtnil) |
((eq type 'stringtnil) |
210 |
(cond ((string= "t" attrvalue) t) |
(cond ((string= "t" attrvalue) t) |
211 |
((string= "nil" attrvalue) nil) |
((string= "nil" attrvalue) nil) |
908 |
(buffer-substring-no-properties |
(buffer-substring-no-properties |
909 |
(match-beginning m-name-pos) |
(match-beginning m-name-pos) |
910 |
(match-end m-name-pos)))) |
(match-end m-name-pos)))) |
911 |
(mm (string-to-int |
(mm (string-to-number |
912 |
(if m-pos |
(if m-pos |
913 |
(buffer-substring-no-properties |
(buffer-substring-no-properties |
914 |
(match-beginning m-pos) |
(match-beginning m-pos) |
915 |
(match-end m-pos)) |
(match-end m-pos)) |
916 |
""))) |
""))) |
917 |
(dd (string-to-int |
(dd (string-to-number |
918 |
(if d-pos |
(if d-pos |
919 |
(buffer-substring-no-properties |
(buffer-substring-no-properties |
920 |
(match-beginning d-pos) |
(match-beginning d-pos) |
931 |
(let* ((current-y |
(let* ((current-y |
932 |
(extract-calendar-year |
(extract-calendar-year |
933 |
(calendar-current-date))) |
(calendar-current-date))) |
934 |
(y (+ (string-to-int y-str) |
(y (+ (string-to-number y-str) |
935 |
(* 100 |
(* 100 |
936 |
(/ current-y 100))))) |
(/ current-y 100))))) |
937 |
(if (> (- y current-y) 50) |
(if (> (- y current-y) 50) |
939 |
(if (> (- current-y y) 50) |
(if (> (- current-y y) 50) |
940 |
(+ y 100) |
(+ y 100) |
941 |
y))) |
y))) |
942 |
(string-to-int y-str)))) |
(string-to-number y-str)))) |
943 |
(save-excursion |
(save-excursion |
944 |
(setq entry (buffer-substring-no-properties |
(setq entry (buffer-substring-no-properties |
945 |
(point) (line-end-position)) |
(point) (line-end-position)) |
1149 |
(cond ((string-match ; Military time |
(cond ((string-match ; Military time |
1150 |
"\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" |
"\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" |
1151 |
s) |
s) |
1152 |
(+ (* 100 (string-to-int |
(+ (* 100 (string-to-number |
1153 |
(substring s (match-beginning 1) (match-end 1)))) |
(substring s (match-beginning 1) (match-end 1)))) |
1154 |
(string-to-int (substring s (match-beginning 2) (match-end 2))))) |
(string-to-number (substring s (match-beginning 2) (match-end 2))))) |
1155 |
((string-match ; Hour only XXam or XXpm |
((string-match ; Hour only XXam or XXpm |
1156 |
"\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s) |
"\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s) |
1157 |
(+ (* 100 (% (string-to-int |
(+ (* 100 (% (string-to-number |
1158 |
(substring s (match-beginning 1) (match-end 1))) |
(substring s (match-beginning 1) (match-end 1))) |
1159 |
12)) |
12)) |
1160 |
(if (equal ?a (downcase (aref s (match-beginning 2)))) |
(if (equal ?a (downcase (aref s (match-beginning 2)))) |
1161 |
0 1200))) |
0 1200))) |
1162 |
((string-match ; Hour and minute XX:XXam or XX:XXpm |
((string-match ; Hour and minute XX:XXam or XX:XXpm |
1163 |
"\\`[ \t\n\\^M]*\\([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) |
1164 |
(+ (* 100 (% (string-to-int |
(+ (* 100 (% (string-to-number |
1165 |
(substring s (match-beginning 1) (match-end 1))) |
(substring s (match-beginning 1) (match-end 1))) |
1166 |
12)) |
12)) |
1167 |
(string-to-int (substring s (match-beginning 2) (match-end 2))) |
(string-to-number (substring s (match-beginning 2) (match-end 2))) |
1168 |
(if (equal ?a (downcase (aref s (match-beginning 3)))) |
(if (equal ?a (downcase (aref s (match-beginning 3)))) |
1169 |
0 1200))) |
0 1200))) |
1170 |
(t diary-unknown-time)))) ; Unrecognizable |
(t diary-unknown-time)))) ; Unrecognizable |