diff options
| author | Richard M. Stallman | 1994-02-07 20:47:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-02-07 20:47:23 +0000 |
| commit | c33579cba6d4e29d95b6f8c8d9dd81dbdb5b251a (patch) | |
| tree | aa347fe41fdd25c926d42a77f6cd113e764f6250 | |
| parent | ffd82264f0afc7b1f6605dd92fd7c3880bb574eb (diff) | |
| download | emacs-c33579cba6d4e29d95b6f8c8d9dd81dbdb5b251a.tar.gz emacs-c33579cba6d4e29d95b6f8c8d9dd81dbdb5b251a.zip | |
(insert-diary-entry,insert-weekly-diary-entry,
insert-monthly-diary-entry,insert-yearly-diary-entry,
insert-anniversary-diary-entry,insert-block-diary-entry,
insert-cyclic-diary-entry,insert-hebrew-diary-entry,
insert-monthly-hebrew-diary-entry,insert-yearly-hebrew-diary-entry,
insert-islamic-diary-entry,insert-monthly-islamic-diary-entry,
insert-yearly-islamic-diary-entry):
Use new error arg to calendar-cursor-to-date.
| -rw-r--r-- | lisp/diary-ins.el | 64 |
1 files changed, 18 insertions, 46 deletions
diff --git a/lisp/diary-ins.el b/lisp/diary-ins.el index a1418479c7e..208253000de 100644 --- a/lisp/diary-ins.el +++ b/lisp/diary-ins.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; diary-ins.el --- calendar functions for adding diary entries. | 1 | ;;; diary-ins.el --- calendar functions for adding diary entries. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1990 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1990, 1994 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> | 5 | ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> |
| 6 | ;; Keywords: diary, calendar | 6 | ;; Keywords: diary, calendar |
| @@ -52,22 +52,15 @@ If omitted, NONMARKING defaults to nil and FILE defaults to diary-file." | |||
| 52 | "Insert a diary entry for the date indicated by point. | 52 | "Insert a diary entry for the date indicated by point. |
| 53 | Prefix arg will make the entry nonmarking." | 53 | Prefix arg will make the entry nonmarking." |
| 54 | (interactive "P") | 54 | (interactive "P") |
| 55 | (make-diary-entry | 55 | (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t t) |
| 56 | (calendar-date-string | 56 | arg)) |
| 57 | (or (calendar-cursor-to-date) | ||
| 58 | (error "Cursor is not on a date!")) | ||
| 59 | t t) | ||
| 60 | arg)) | ||
| 61 | 57 | ||
| 62 | (defun insert-weekly-diary-entry (arg) | 58 | (defun insert-weekly-diary-entry (arg) |
| 63 | "Insert a weekly diary entry for the day of the week indicated by point. | 59 | "Insert a weekly diary entry for the day of the week indicated by point. |
| 64 | Prefix arg will make the entry nonmarking." | 60 | Prefix arg will make the entry nonmarking." |
| 65 | (interactive "P") | 61 | (interactive "P") |
| 66 | (make-diary-entry | 62 | (make-diary-entry (calendar-day-name (calendar-cursor-to-date t)) |
| 67 | (calendar-day-name | 63 | arg)) |
| 68 | (or (calendar-cursor-to-date) | ||
| 69 | (error "Cursor is not on a date!"))) | ||
| 70 | arg)) | ||
| 71 | 64 | ||
| 72 | (defun insert-monthly-diary-entry (arg) | 65 | (defun insert-monthly-diary-entry (arg) |
| 73 | "Insert a monthly diary entry for the day of the month indicated by point. | 66 | "Insert a monthly diary entry for the day of the month indicated by point. |
| @@ -77,12 +70,8 @@ Prefix arg will make the entry nonmarking." | |||
| 77 | (if european-calendar-style | 70 | (if european-calendar-style |
| 78 | '(day " * ") | 71 | '(day " * ") |
| 79 | '("* " day)))) | 72 | '("* " day)))) |
| 80 | (make-diary-entry | 73 | (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t) |
| 81 | (calendar-date-string | 74 | arg))) |
| 82 | (or (calendar-cursor-to-date) | ||
| 83 | (error "Cursor is not on a date!")) | ||
| 84 | t) | ||
| 85 | arg))) | ||
| 86 | 75 | ||
| 87 | (defun insert-yearly-diary-entry (arg) | 76 | (defun insert-yearly-diary-entry (arg) |
| 88 | "Insert an annual diary entry for the day of the year indicated by point. | 77 | "Insert an annual diary entry for the day of the year indicated by point. |
| @@ -92,12 +81,8 @@ Prefix arg will make the entry nonmarking." | |||
| 92 | (if european-calendar-style | 81 | (if european-calendar-style |
| 93 | '(day " " monthname) | 82 | '(day " " monthname) |
| 94 | '(monthname " " day)))) | 83 | '(monthname " " day)))) |
| 95 | (make-diary-entry | 84 | (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t) |
| 96 | (calendar-date-string | 85 | arg))) |
| 97 | (or (calendar-cursor-to-date) | ||
| 98 | (error "Cursor is not on a date!")) | ||
| 99 | t) | ||
| 100 | arg))) | ||
| 101 | 86 | ||
| 102 | (defun insert-anniversary-diary-entry (arg) | 87 | (defun insert-anniversary-diary-entry (arg) |
| 103 | "Insert an anniversary diary entry for the date given by point. | 88 | "Insert an anniversary diary entry for the date given by point. |
| @@ -110,10 +95,7 @@ Prefix arg will make the entry nonmarking." | |||
| 110 | (make-diary-entry | 95 | (make-diary-entry |
| 111 | (format "%s(diary-anniversary %s)" | 96 | (format "%s(diary-anniversary %s)" |
| 112 | sexp-diary-entry-symbol | 97 | sexp-diary-entry-symbol |
| 113 | (calendar-date-string | 98 | (calendar-date-string (calendar-cursor-to-date t) nil t)) |
| 114 | (or (calendar-cursor-to-date) | ||
| 115 | (error "Cursor is not on a date!")) | ||
| 116 | nil t)) | ||
| 117 | arg))) | 99 | arg))) |
| 118 | 100 | ||
| 119 | (defun insert-block-diary-entry (arg) | 101 | (defun insert-block-diary-entry (arg) |
| @@ -124,8 +106,7 @@ Prefix arg will make the entry nonmarking." | |||
| 124 | (if european-calendar-style | 106 | (if european-calendar-style |
| 125 | '(day " " month " " year) | 107 | '(day " " month " " year) |
| 126 | '(month " " day " " year))) | 108 | '(month " " day " " year))) |
| 127 | (cursor (or (calendar-cursor-to-date) | 109 | (cursor (calendar-cursor-to-date t)) |
| 128 | (error "Cursor is not on a date!"))) | ||
| 129 | (mark (or (car calendar-mark-ring) | 110 | (mark (or (car calendar-mark-ring) |
| 130 | (error "No mark set in this buffer"))) | 111 | (error "No mark set in this buffer"))) |
| 131 | (start) | 112 | (start) |
| @@ -156,10 +137,7 @@ Prefix arg will make the entry nonmarking." | |||
| 156 | sexp-diary-entry-symbol | 137 | sexp-diary-entry-symbol |
| 157 | (calendar-read "Repeat every how many days: " | 138 | (calendar-read "Repeat every how many days: " |
| 158 | '(lambda (x) (> x 0))) | 139 | '(lambda (x) (> x 0))) |
| 159 | (calendar-date-string | 140 | (calendar-date-string (calendar-cursor-to-date t) nil t)) |
| 160 | (or (calendar-cursor-to-date) | ||
| 161 | (error "Cursor is not on a date!")) | ||
| 162 | nil t)) | ||
| 163 | arg))) | 141 | arg))) |
| 164 | 142 | ||
| 165 | (defun insert-hebrew-diary-entry (arg) | 143 | (defun insert-hebrew-diary-entry (arg) |
| @@ -175,8 +153,7 @@ Prefix arg will make the entry nonmarking." | |||
| 175 | (calendar-date-string | 153 | (calendar-date-string |
| 176 | (calendar-hebrew-from-absolute | 154 | (calendar-hebrew-from-absolute |
| 177 | (calendar-absolute-from-gregorian | 155 | (calendar-absolute-from-gregorian |
| 178 | (or (calendar-cursor-to-date) | 156 | (calendar-cursor-to-date t))) |
| 179 | (error "Cursor is not on a date!")))) | ||
| 180 | nil t)) | 157 | nil t)) |
| 181 | arg))) | 158 | arg))) |
| 182 | 159 | ||
| @@ -195,8 +172,7 @@ Prefix arg will make the entry nonmarking." | |||
| 195 | (calendar-date-string | 172 | (calendar-date-string |
| 196 | (calendar-hebrew-from-absolute | 173 | (calendar-hebrew-from-absolute |
| 197 | (calendar-absolute-from-gregorian | 174 | (calendar-absolute-from-gregorian |
| 198 | (or (calendar-cursor-to-date) | 175 | (calendar-cursor-to-date t))))) |
| 199 | (error "Cursor is not on a date!")))))) | ||
| 200 | arg))) | 176 | arg))) |
| 201 | 177 | ||
| 202 | (defun insert-yearly-hebrew-diary-entry (arg) | 178 | (defun insert-yearly-hebrew-diary-entry (arg) |
| @@ -216,8 +192,7 @@ Prefix arg will make the entry nonmarking." | |||
| 216 | (calendar-date-string | 192 | (calendar-date-string |
| 217 | (calendar-hebrew-from-absolute | 193 | (calendar-hebrew-from-absolute |
| 218 | (calendar-absolute-from-gregorian | 194 | (calendar-absolute-from-gregorian |
| 219 | (or (calendar-cursor-to-date) | 195 | (calendar-cursor-to-date t))))) |
| 220 | (error "Cursor is not on a date!")))))) | ||
| 221 | arg))) | 196 | arg))) |
| 222 | 197 | ||
| 223 | (defun insert-islamic-diary-entry (arg) | 198 | (defun insert-islamic-diary-entry (arg) |
| @@ -232,8 +207,7 @@ Prefix arg will make the entry nonmarking." | |||
| 232 | (calendar-date-string | 207 | (calendar-date-string |
| 233 | (calendar-islamic-from-absolute | 208 | (calendar-islamic-from-absolute |
| 234 | (calendar-absolute-from-gregorian | 209 | (calendar-absolute-from-gregorian |
| 235 | (or (calendar-cursor-to-date) | 210 | (calendar-cursor-to-date t))) |
| 236 | (error "Cursor is not on a date!")))) | ||
| 237 | nil t)) | 211 | nil t)) |
| 238 | arg))) | 212 | arg))) |
| 239 | 213 | ||
| @@ -251,8 +225,7 @@ Prefix arg will make the entry nonmarking." | |||
| 251 | (calendar-date-string | 225 | (calendar-date-string |
| 252 | (calendar-islamic-from-absolute | 226 | (calendar-islamic-from-absolute |
| 253 | (calendar-absolute-from-gregorian | 227 | (calendar-absolute-from-gregorian |
| 254 | (or (calendar-cursor-to-date) | 228 | (calendar-cursor-to-date t))))) |
| 255 | (error "Cursor is not on a date!")))))) | ||
| 256 | arg))) | 229 | arg))) |
| 257 | 230 | ||
| 258 | (defun insert-yearly-islamic-diary-entry (arg) | 231 | (defun insert-yearly-islamic-diary-entry (arg) |
| @@ -271,8 +244,7 @@ Prefix arg will make the entry nonmarking." | |||
| 271 | (calendar-date-string | 244 | (calendar-date-string |
| 272 | (calendar-islamic-from-absolute | 245 | (calendar-islamic-from-absolute |
| 273 | (calendar-absolute-from-gregorian | 246 | (calendar-absolute-from-gregorian |
| 274 | (or (calendar-cursor-to-date) | 247 | (calendar-cursor-to-date t))))) |
| 275 | (error "Cursor is not on a date!")))))) | ||
| 276 | arg))) | 248 | arg))) |
| 277 | 249 | ||
| 278 | (provide 'diary-ins) | 250 | (provide 'diary-ins) |