aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calendar/cal-bahai.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el
index c1eb86b62eb..f18b88528e9 100644
--- a/lisp/calendar/cal-bahai.el
+++ b/lisp/calendar/cal-bahai.el
@@ -1,4 +1,4 @@
1;;; cal-bahai.el --- calendar functions for the Bahá'í calendar. -*- coding: utf-8 -*- 1;;; cal-bahai.el --- calendar functions for the Bahá'í calendar.
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 3;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
@@ -118,6 +118,7 @@ Gregorian date Sunday, December 31, 1 BC."
118 (1- (calendar-absolute-from-bahai (list month 1 year)))))) 118 (1- (calendar-absolute-from-bahai (list month 1 year))))))
119 (list month day year)))) 119 (list month day year))))
120 120
121;;;###autoload
121(defun calendar-bahai-date-string (&optional date) 122(defun calendar-bahai-date-string (&optional date)
122 "String of Bahá'í date of Gregorian DATE. 123 "String of Bahá'í date of Gregorian DATE.
123Defaults to today's date if DATE is not given." 124Defaults to today's date if DATE is not given."
@@ -143,12 +144,14 @@ Defaults to today's date if DATE is not given."
143 (year (int-to-string y))) 144 (year (int-to-string y)))
144 (mapconcat 'eval calendar-date-display-form "")))) 145 (mapconcat 'eval calendar-date-display-form ""))))
145 146
147;;;###autoload
146(defun calendar-bahai-print-date () 148(defun calendar-bahai-print-date ()
147 "Show the Bahá'í calendar equivalent of the selected date." 149 "Show the Bahá'í calendar equivalent of the selected date."
148 (interactive) 150 (interactive)
149 (message "Bahá'í date: %s" 151 (message "Bahá'í date: %s"
150 (calendar-bahai-date-string (calendar-cursor-to-date t)))) 152 (calendar-bahai-date-string (calendar-cursor-to-date t))))
151 153
154;;;###autoload
152(defun calendar-bahai-goto-date (date &optional noecho) 155(defun calendar-bahai-goto-date (date &optional noecho)
153 "Move cursor to Bahá'í date DATE. 156 "Move cursor to Bahá'í date DATE.
154Echo Bahá'í date unless NOECHO is t." 157Echo Bahá'í date unless NOECHO is t."
@@ -162,7 +165,7 @@ Echo Bahá'í date unless NOECHO is t."
162 (let* ((today (calendar-current-date)) 165 (let* ((today (calendar-current-date))
163 (year (calendar-read 166 (year (calendar-read
164 "Bahá'í calendar year (not 0): " 167 "Bahá'í calendar year (not 0): "
165 '(lambda (x) (/= x 0)) 168 (lambda (x) (/= x 0))
166 (int-to-string 169 (int-to-string
167 (extract-calendar-year 170 (extract-calendar-year
168 (calendar-bahai-from-absolute 171 (calendar-bahai-from-absolute
@@ -177,7 +180,7 @@ Echo Bahá'í date unless NOECHO is t."
177 (calendar-make-alist calendar-bahai-month-name-array 180 (calendar-make-alist calendar-bahai-month-name-array
178 1)))) 181 1))))
179 (day (calendar-read "Bahá'í calendar day (1-19): " 182 (day (calendar-read "Bahá'í calendar day (1-19): "
180 '(lambda (x) (and (< 0 x) (<= x 19)))))) 183 (lambda (x) (and (< 0 x) (<= x 19))))))
181 (list (list month day year)))) 184 (list (list month day year))))
182 185
183(defun diary-bahai-date () 186(defun diary-bahai-date ()
@@ -396,7 +399,7 @@ nongregorian-diary-marking-hook."
396 (calendar-make-alist 399 (calendar-make-alist
397 calendar-day-name-array 400 calendar-day-name-array
398 0 401 0
399 '(lambda (x) (substring x 0 3))) 402 (lambda (x) (substring x 0 3)))
400 t))) 403 t)))
401 (if mm-name 404 (if mm-name
402 (if (string-equal mm-name "*") 405 (if (string-equal mm-name "*")
@@ -468,6 +471,7 @@ A value of 0 in any position is a wildcard."
468 (mark-visible-calendar-date 471 (mark-visible-calendar-date
469 (calendar-gregorian-from-absolute date))))))))) 472 (calendar-gregorian-from-absolute date)))))))))
470 473
474;;;###autoload
471(defun diary-bahai-insert-entry (arg) 475(defun diary-bahai-insert-entry (arg)
472 "Insert a diary entry. 476 "Insert a diary entry.
473For the Bahá'í date corresponding to the date indicated by point. 477For the Bahá'í date corresponding to the date indicated by point.
@@ -484,6 +488,7 @@ Prefix arg will make the entry nonmarking."
484 nil t)) 488 nil t))
485 arg))) 489 arg)))
486 490
491;;;###autoload
487(defun diary-bahai-insert-monthly-entry (arg) 492(defun diary-bahai-insert-monthly-entry (arg)
488 "Insert a monthly diary entry. 493 "Insert a monthly diary entry.
489For the day of the Bahá'í month corresponding to the date indicated by point. 494For the day of the Bahá'í month corresponding to the date indicated by point.
@@ -501,6 +506,7 @@ Prefix arg will make the entry nonmarking."
501 (calendar-cursor-to-date t))))) 506 (calendar-cursor-to-date t)))))
502 arg))) 507 arg)))
503 508
509;;;###autoload
504(defun diary-bahai-insert-yearly-entry (arg) 510(defun diary-bahai-insert-yearly-entry (arg)
505 "Insert an annual diary entry. 511 "Insert an annual diary entry.
506For the day of the Bahá'í year corresponding to the date indicated by point. 512For the day of the Bahá'í year corresponding to the date indicated by point.
@@ -540,5 +546,10 @@ Prefix arg will make the entry nonmarking."
540 546
541(provide 'cal-bahai) 547(provide 'cal-bahai)
542 548
549;; Local Variables:
550;; coding: utf-8
551;; generated-autoload-file: "cal-loaddefs.el"
552;; End:
553
543;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14 554;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14
544;;; cal-bahai.el ends here 555;;; cal-bahai.el ends here