]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/cal-bahai.el
(hack-local-variables-confirm) <offer-save>: Clarify message text. Suggested
[gnu-emacs] / lisp / calendar / cal-bahai.el
index 24486b7cae296a41e72ddd53a25d49f21f7ac6d1..f6419cf9a82bf212ca5a3b3972664bc000bbe370 100644 (file)
@@ -1,6 +1,7 @@
 ;;; cal-bahai.el --- calendar functions for the Baha'i calendar.
 
-;; Copyright (C) 2001 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+;;   Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Keywords: calendar
@@ -20,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 
 ;;; Code:
 
+(defvar date)
+(defvar displayed-month)
+(defvar displayed-year)
+(defvar number)
+(defvar original-date)
+
 (require 'cal-julian)
 
 (defvar bahai-calendar-month-name-array
@@ -215,7 +222,7 @@ calendar.  This function is provided for use with the
             (mark (regexp-quote diary-nonmarking-symbol)))
         (calendar-for-loop i from 1 to number do
            (let* ((d diary-date-forms)
-                  (bdate (calendar-bahai-from-absolute 
+                  (bdate (calendar-bahai-from-absolute
                           (calendar-absolute-from-gregorian gdate)))
                   (month (extract-calendar-month bdate))
                   (day (extract-calendar-day bdate))
@@ -340,13 +347,13 @@ nongregorian-diary-marking-hook."
                       (buffer-substring
                        (match-beginning m-name-pos)
                        (match-end m-name-pos))))
-                 (mm (string-to-int
+                 (mm (string-to-number
                       (if m-pos
                           (buffer-substring
                            (match-beginning m-pos)
                            (match-end m-pos))
                         "")))
-                 (dd (string-to-int
+                 (dd (string-to-number
                       (if d-pos
                           (buffer-substring
                            (match-beginning d-pos)
@@ -365,29 +372,31 @@ nongregorian-diary-marking-hook."
                                     (calendar-bahai-from-absolute
                                      (calendar-absolute-from-gregorian
                                       (calendar-current-date)))))
-                                  (y (+ (string-to-int y-str)
+                                  (y (+ (string-to-number y-str)
                                         (* 100 (/ current-y 100)))))
                              (if (> (- y current-y) 50)
                                  (- y 100)
                                (if (> (- current-y y) 50)
                                    (+ y 100)
                                  y)))
-                         (string-to-int y-str)))))
+                         (string-to-number y-str)))))
             (if dd-name
                 (mark-calendar-days-named
-                 (cdr (assoc-ignore-case (substring dd-name 0 3)
-                                         (calendar-make-alist
-                                          calendar-day-name-array
-                                          0
-                                          '(lambda (x) (substring x 0 3))))))
+                 (cdr (assoc-string (substring dd-name 0 3)
+                                    (calendar-make-alist
+                                     calendar-day-name-array
+                                     0
+                                     '(lambda (x) (substring x 0 3)))
+                                    t)))
               (if mm-name
                   (if (string-equal mm-name "*")
                       (setq mm 0)
                     (setq mm
-                          (cdr (assoc-ignore-case
+                          (cdr (assoc-string
                                 mm-name
                                 (calendar-make-alist
-                                  bahai-calendar-month-name-array))))))
+                                  bahai-calendar-month-name-array)
+                                t)))))
               (mark-bahai-calendar-date-pattern mm dd yy)))))
       (setq d (cdr d)))))
 
@@ -458,7 +467,7 @@ Prefix arg will make the entry nonmarking."
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
-      (calendar-date-string 
+      (calendar-date-string
        (calendar-bahai-from-absolute
         (calendar-absolute-from-gregorian
          (calendar-cursor-to-date t)))
@@ -476,7 +485,7 @@ Prefix arg will make the entry nonmarking."
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
-      (calendar-date-string 
+      (calendar-date-string
        (calendar-bahai-from-absolute
         (calendar-absolute-from-gregorian
          (calendar-cursor-to-date t)))))
@@ -495,7 +504,7 @@ Prefix arg will make the entry nonmarking."
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
-      (calendar-date-string 
+      (calendar-date-string
        (calendar-bahai-from-absolute
         (calendar-absolute-from-gregorian
          (calendar-cursor-to-date t)))))
@@ -503,4 +512,5 @@ Prefix arg will make the entry nonmarking."
 
 (provide 'cal-bahai)
 
+;;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14
 ;;; cal-bahai.el ends here