comparison lisp/calendar/cal-bahai.el @ 93372:ed15c3f99e18

Autoload diary-insert-entry-1. (diary-bahai-insert-entry, diary-bahai-insert-monthly-entry) (diary-bahai-insert-yearly-entry): Use diary-insert-entry-1.
author Glenn Morris <rgm@gnu.org>
date Sat, 29 Mar 2008 02:42:52 +0000
parents 9425e236c79d
children 6181940a6360
comparison
equal deleted inserted replaced
93371:b6fc476e0627 93372:ed15c3f99e18
204 (let* ((bahai-date (calendar-bahai-from-absolute 204 (let* ((bahai-date (calendar-bahai-from-absolute
205 (calendar-absolute-from-gregorian 205 (calendar-absolute-from-gregorian
206 (list displayed-month 15 displayed-year)))) 206 (list displayed-month 15 displayed-year))))
207 (m (extract-calendar-month bahai-date)) 207 (m (extract-calendar-month bahai-date))
208 (y (extract-calendar-year bahai-date)) 208 (y (extract-calendar-year bahai-date))
209 (date)) 209 date)
210 (unless (< m 1) ; Bahá'í calendar doesn't apply 210 (unless (< m 1) ; Bahá'í calendar doesn't apply
211 (increment-calendar-month m y (- 10 month)) 211 (increment-calendar-month m y (- 10 month))
212 (if (> m 7) ; Bahá'í date might be visible 212 (if (> m 7) ; Bahá'í date might be visible
213 (let ((date (calendar-gregorian-from-absolute 213 (let ((date (calendar-gregorian-from-absolute
214 (calendar-absolute-from-bahai (list month day y))))) 214 (calendar-absolute-from-bahai (list month day y)))))
262 'calendar-bahai-mark-date-pattern)) 262 'calendar-bahai-mark-date-pattern))
263 263
264 (define-obsolete-function-alias 264 (define-obsolete-function-alias
265 'mark-bahai-diary-entries 'diary-bahai-mark-entries "23.1") 265 'mark-bahai-diary-entries 'diary-bahai-mark-entries "23.1")
266 266
267
268 (autoload 'diary-insert-entry-1 "diary-lib")
269
267 ;;;###cal-autoload 270 ;;;###cal-autoload
268 (defun diary-bahai-insert-entry (arg) 271 (defun diary-bahai-insert-entry (arg)
269 "Insert a diary entry. 272 "Insert a diary entry.
270 For the Bahá'í date corresponding to the date indicated by point. 273 For the Bahá'í date corresponding to the date indicated by point.
271 Prefix argument ARG makes the entry nonmarking." 274 Prefix argument ARG makes the entry nonmarking."
272 (interactive "P") 275 (interactive "P")
273 (let ((calendar-month-name-array calendar-bahai-month-name-array)) 276 (diary-insert-entry-1 nil arg calendar-bahai-month-name-array
274 (make-diary-entry 277 bahai-diary-entry-symbol
275 (concat bahai-diary-entry-symbol 278 'calendar-bahai-from-absolute))
276 (calendar-date-string
277 (calendar-bahai-from-absolute
278 (calendar-absolute-from-gregorian (calendar-cursor-to-date t)))
279 nil t))
280 arg)))
281 279
282 (define-obsolete-function-alias 280 (define-obsolete-function-alias
283 'insert-bahai-diary-entry 'diary-bahai-insert-entry "23.1") 281 'insert-bahai-diary-entry 'diary-bahai-insert-entry "23.1")
284 282
285 ;;;###cal-autoload 283 ;;;###cal-autoload
286 (defun diary-bahai-insert-monthly-entry (arg) 284 (defun diary-bahai-insert-monthly-entry (arg)
287 "Insert a monthly diary entry. 285 "Insert a monthly diary entry.
288 For the day of the Bahá'í month corresponding to the date indicated by point. 286 For the day of the Bahá'í month corresponding to the date indicated by point.
289 Prefix argument ARG makes the entry nonmarking." 287 Prefix argument ARG makes the entry nonmarking."
290 (interactive "P") 288 (interactive "P")
291 (let ((calendar-date-display-form (if european-calendar-style 289 (diary-insert-entry-1 'monthly arg calendar-bahai-month-name-array
292 '(day " * ") 290 bahai-diary-entry-symbol
293 '("* " day ))) 291 'calendar-bahai-from-absolute))
294 (calendar-month-name-array calendar-bahai-month-name-array))
295 (make-diary-entry
296 (concat bahai-diary-entry-symbol
297 (calendar-date-string
298 (calendar-bahai-from-absolute
299 (calendar-absolute-from-gregorian (calendar-cursor-to-date t)))))
300 arg)))
301 292
302 (define-obsolete-function-alias 293 (define-obsolete-function-alias
303 'insert-monthly-bahai-diary-entry 'diary-bahai-insert-monthly-entry "23.1") 294 'insert-monthly-bahai-diary-entry 'diary-bahai-insert-monthly-entry "23.1")
304 295
305 ;;;###cal-autoload 296 ;;;###cal-autoload
306 (defun diary-bahai-insert-yearly-entry (arg) 297 (defun diary-bahai-insert-yearly-entry (arg)
307 "Insert an annual diary entry. 298 "Insert an annual diary entry.
308 For the day of the Bahá'í year corresponding to the date indicated by point. 299 For the day of the Bahá'í year corresponding to the date indicated by point.
309 Prefix argument ARG will make the entry nonmarking." 300 Prefix argument ARG will make the entry nonmarking."
310 (interactive "P") 301 (interactive "P")
311 (let ((calendar-date-display-form (if european-calendar-style 302 (diary-insert-entry-1 'yearly arg calendar-bahai-month-name-array
312 '(day " " monthname) 303 bahai-diary-entry-symbol
313 '(monthname " " day))) 304 'calendar-bahai-from-absolute))
314 (calendar-month-name-array calendar-bahai-month-name-array))
315 (make-diary-entry
316 (concat bahai-diary-entry-symbol
317 (calendar-date-string
318 (calendar-bahai-from-absolute
319 (calendar-absolute-from-gregorian (calendar-cursor-to-date t)))))
320 arg)))
321 305
322 (define-obsolete-function-alias 306 (define-obsolete-function-alias
323 'insert-yearly-bahai-diary-entry 'diary-bahai-insert-yearly-entry "23.1") 307 'insert-yearly-bahai-diary-entry 'diary-bahai-insert-yearly-entry "23.1")
324 308
325 (defvar date) 309 (defvar date)