changeset 82177:f673ee49d36e

(calendar-bahai-month-name-array, calendar-bahai-epoch) (calendar-bahai-leap-year-p, calendar-bahai-leap-base, diary-list-bahai-entries) (calendar-bahai-prompt-for-date, diary-bahai-mark-entries) (calendar-bahai-mark-date-pattern, diary-insert-bahai-entry) (diary-bahai-insert-monthly-entry, diary-bahai-insert-yearly-entry): New names to clean up namespace. (list-bahai-diary-entries, mark-bahai-diary-entries) (insert-bahai-diary-entry, insert-monthly-bahai-diary-entry) (insert-yearly-bahai-diary-entry, mark-bahai-calendar-date-pattern): Add compatibility aliases.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 27 Jul 2007 20:24:09 +0000
parents 907a4e983597
children 05a92f4e34f4
files lisp/ChangeLog lisp/calendar/cal-bahai.el
diffstat 2 files changed, 51 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jul 27 20:00:05 2007 +0000
+++ b/lisp/ChangeLog	Fri Jul 27 20:24:09 2007 +0000
@@ -1,5 +1,17 @@
 2007-07-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* calendar/cal-bahai.el (calendar-bahai-month-name-array)
+	(calendar-bahai-epoch, calendar-bahai-leap-year-p)
+	(calendar-bahai-leap-base, calendar-bahai-prompt-for-date)
+	(diary-list-bahai-entries, diary-bahai-mark-entries)
+	(calendar-bahai-mark-date-pattern, diary-insert-bahai-entry)
+	(diary-bahai-insert-monthly-entry, diary-bahai-insert-yearly-entry):
+	New names to clean up namespace.
+	(list-bahai-diary-entries, mark-bahai-diary-entries)
+	(insert-bahai-diary-entry, insert-monthly-bahai-diary-entry)
+	(insert-yearly-bahai-diary-entry, mark-bahai-calendar-date-pattern):
+	Add compatibility aliases.
+
 	* calendar/appt.el: Don't wrap defvar within eval-when-compile.
 
 	* calendar/cal-move.el (calendar-scroll-left, calendar-scroll-right)
--- a/lisp/calendar/cal-bahai.el	Fri Jul 27 20:00:05 2007 +0000
+++ b/lisp/calendar/cal-bahai.el	Fri Jul 27 20:24:09 2007 +0000
@@ -63,19 +63,19 @@
 
 (require 'cal-julian)
 
-(defvar bahai-calendar-month-name-array
+(defconst calendar-bahai-month-name-array
   ["Baha" "Jalal" "Jamal" "`Azamat" "Nur" "Rahmat" "Kalimat" "Kamal"
    "Asma" "`Izzat" "Mashiyyat" "`Ilm" "Qudrat" "Qawl" "Masa'il"
    "Sharaf" "Sultan" "Mulk" "`Ala"])
 
-(defvar calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1844))
+(defconst calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1844))
   "Absolute date of start of Baha'i calendar = March 19, 622 A.D. (Julian).")
 
-(defun bahai-calendar-leap-year-p (year)
+(defun calendar-bahai-leap-year-p (year)
   "True if YEAR is a leap year on the Baha'i calendar."
   (calendar-leap-year-p (+ year 1844)))
 
-(defvar bahai-calendar-leap-base
+(defconst calendar-bahai-leap-base
   (+ (/ 1844 4) (- (/ 1844 100)) (/ 1844 400)))
 
 (defun calendar-absolute-from-bahai (date)
@@ -89,7 +89,7 @@
 	 (leap-days (- (+ (/ prior-years 4) ; Leap days in prior years.
 			  (- (/ prior-years 100))
 			  (/ prior-years 400))
-		       bahai-calendar-leap-base)))
+		       calendar-bahai-leap-base)))
     (+ (1- calendar-bahai-epoch)	; Days before epoch
        (* 365 (1- year))		; Days in prior years.
        leap-days
@@ -131,10 +131,10 @@
 	   (if (and (= m 19)
 		    (<= d 0))
 	       "Ayyam-i-Ha"
-	     (aref bahai-calendar-month-name-array (1- m))))
+	     (aref calendar-bahai-month-name-array (1- m))))
 	  (day (int-to-string
 		(if (<= d 0)
-		    (if (bahai-calendar-leap-year-p y)
+		    (if (calendar-bahai-leap-year-p y)
 			(+ d 5)
 		      (+ d 4))
 		  d)))
@@ -152,12 +152,12 @@
 (defun calendar-goto-bahai-date (date &optional noecho)
   "Move cursor to Baha'i date DATE.
 Echo Baha'i date unless NOECHO is t."
-  (interactive (bahai-prompt-for-date))
+  (interactive (calendar-bahai-prompt-for-date))
   (calendar-goto-date (calendar-gregorian-from-absolute
                        (calendar-absolute-from-bahai date)))
   (or noecho (calendar-print-bahai-date)))
 
-(defun bahai-prompt-for-date ()
+(defun calendar-bahai-prompt-for-date ()
   "Ask for a Baha'i date."
   (let* ((today (calendar-current-date))
          (year (calendar-read
@@ -172,9 +172,9 @@
                        (completing-read
                         "Baha'i calendar month name: "
                         (mapcar 'list
-                                (append bahai-calendar-month-name-array nil))
+                                (append calendar-bahai-month-name-array nil))
                         nil t)
-                      (calendar-make-alist bahai-calendar-month-name-array
+                      (calendar-make-alist calendar-bahai-month-name-array
                                            1))))
          (day (calendar-read "Baha'i calendar day (1-19): "
 			     '(lambda (x) (and (< 0 x) (<= x 19))))))
@@ -204,7 +204,7 @@
             (if (calendar-date-is-visible-p date)
                 (list (list date string))))))))
 
-(defun list-bahai-diary-entries ()
+(defun diary-list-bahai-entries ()
   "Add any Baha'i date entries from the diary file to `diary-entries-list'.
 Baha'i date diary entries must be prefaced by an
 `bahai-diary-entry-symbol' (normally a `B').  The same diary date
@@ -238,7 +238,7 @@
                      (calendar-day-name gdate) "\\|"
                      (substring (calendar-day-name gdate) 0 3) ".?"))
                    (calendar-month-name-array
-                    bahai-calendar-month-name-array)
+                    calendar-bahai-month-name-array)
                    (monthname
                     (concat
                      "\\*\\|"
@@ -290,7 +290,7 @@
         (set-buffer-modified-p diary-modified))
     (goto-char (point-min))))
 
-(defun mark-bahai-diary-entries ()
+(defun diary-bahai-mark-entries ()
   "Mark days in the calendar window that have Baha'i date diary entries.
 Each entry in diary-file (or included files) visible in the calendar
 window is marked.  Baha'i date entries are prefaced by a
@@ -311,7 +311,7 @@
            (dayname (diary-name-pattern calendar-day-name-array))
            (monthname
             (concat
-             (diary-name-pattern bahai-calendar-month-name-array t)
+             (diary-name-pattern calendar-bahai-month-name-array t)
              "\\|\\*"))
            (month "[0-9]+\\|\\*")
            (day "[0-9]+\\|\\*")
@@ -395,12 +395,12 @@
                           (cdr (assoc-string
                                 mm-name
                                 (calendar-make-alist
-                                  bahai-calendar-month-name-array)
+                                  calendar-bahai-month-name-array)
                                 t)))))
-              (mark-bahai-calendar-date-pattern mm dd yy)))))
+              (calendar-bahai-mark-date-pattern mm dd yy)))))
       (setq d (cdr d)))))
 
-(defun mark-bahai-calendar-date-pattern (month day year)
+(defun calendar-bahai-mark-date-pattern (month day year)
   "Mark dates in calendar window that conform to Baha'i date MONTH/DAY/YEAR.
 A value of 0 in any position is a wildcard."
   (save-excursion
@@ -458,12 +458,12 @@
                  (mark-visible-calendar-date
                   (calendar-gregorian-from-absolute date)))))))))
 
-(defun insert-bahai-diary-entry (arg)
+(defun diary-insert-bahai-entry (arg)
   "Insert a diary entry.
 For the Baha'i date corresponding to the date indicated by point.
 Prefix arg will make the entry nonmarking."
   (interactive "P")
-  (let* ((calendar-month-name-array bahai-calendar-month-name-array))
+  (let* ((calendar-month-name-array calendar-bahai-month-name-array))
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
@@ -474,14 +474,14 @@
        nil t))
      arg)))
 
-(defun insert-monthly-bahai-diary-entry (arg)
+(defun diary-bahai-insert-monthly-entry (arg)
   "Insert a monthly diary entry.
 For the day of the Baha'i month corresponding to the date indicated by point.
 Prefix arg will make the entry nonmarking."
   (interactive "P")
   (let* ((calendar-date-display-form
           (if european-calendar-style '(day " * ") '("* " day )))
-         (calendar-month-name-array bahai-calendar-month-name-array))
+         (calendar-month-name-array calendar-bahai-month-name-array))
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
@@ -491,7 +491,7 @@
          (calendar-cursor-to-date t)))))
      arg)))
 
-(defun insert-yearly-bahai-diary-entry (arg)
+(defun diary-bahai-insert-yearly-entry (arg)
   "Insert an annual diary entry.
 For the day of the Baha'i year corresponding to the date indicated by point.
 Prefix arg will make the entry nonmarking."
@@ -500,7 +500,7 @@
           (if european-calendar-style
               '(day " " monthname)
             '(monthname " " day)))
-         (calendar-month-name-array bahai-calendar-month-name-array))
+         (calendar-month-name-array calendar-bahai-month-name-array))
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
@@ -510,7 +510,21 @@
          (calendar-cursor-to-date t)))))
      arg)))
 
+;; Backward compatibility.
+(define-obsolete-function-alias
+  'list-bahai-diary-entries 'diary-list-bahai-entries "23.1")
+(define-obsolete-function-alias
+  'mark-bahai-diary-entries 'diary-mark-bahai-entries "23.1")
+(define-obsolete-function-alias
+  'insert-bahai-diary-entry 'diary-insert-bahai-entry "23.1")
+(define-obsolete-function-alias
+  'insert-monthly-bahai-diary-entry 'diary-insert-bahai-monthly-entry "23.1")
+(define-obsolete-function-alias
+  'insert-yearly-bahai-diary-entry 'diary-insert-bahai-yearly-entry "23.1")
+(define-obsolete-function-alias
+  'mark-bahai-calendar-date-pattern 'calendar-bahai-mark-date-pattern "23.1")
+
 (provide 'cal-bahai)
 
-;;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14
+;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14
 ;;; cal-bahai.el ends here