]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/cal-islam.el
(ido-enable-prefix): Improve previous doc fix.
[gnu-emacs] / lisp / calendar / cal-islam.el
index 482b77d74d933772d68ae2e48bbd2c98a4df290a..105bb288eb0b18d10d0a7778e5365d6a0571bf3d 100644 (file)
@@ -1,8 +1,10 @@
 ;;; cal-islam.el --- calendar functions for the Islamic calendar
 
-;; Copyright (C) 1995, 1997, 2001, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
+;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Keywords: calendar
 ;; Human-Keywords: Islamic calendar, calendar, diary
 
@@ -20,8 +22,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:
 
@@ -29,8 +31,8 @@
 ;; diary.el that deal with the Islamic calendar.
 
 ;; Technical details of all the calendrical calculations can be found in
-;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold,
-;; Cambridge University Press (1997).
+;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
+;; and Nachum Dershowitz, Cambridge University Press (2001).
 
 ;; Comments, corrections, and improvements should be sent to
 ;;  Edward M. Reingold               Department of Computer Science
 
 ;;; Code:
 
+(defvar date)
 (defvar displayed-month)
 (defvar displayed-year)
+(defvar number)
+(defvar original-date)
 
 (require 'cal-julian)
 
@@ -154,12 +159,12 @@ Driven by the variable `calendar-date-display-form'."
                     (calendar-absolute-from-gregorian today))))))
           (month-array calendar-islamic-month-name-array)
           (completion-ignore-case t)
-          (month (cdr (assoc-ignore-case
+          (month (cdr (assoc-string
                         (completing-read
                          "Islamic calendar month name: "
                          (mapcar 'list (append month-array nil))
                          nil t)
-                       (calendar-make-alist month-array 1))))
+                       (calendar-make-alist month-array 1) t)))
           (last (islamic-calendar-last-day-of-month month year))
           (day (calendar-read
                 (format "Islamic calendar day (1-%d): " last)
@@ -337,13 +342,13 @@ provided for use as part of the 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)
@@ -362,26 +367,26 @@ provided for use as part of the nongregorian-diary-marking-hook."
                                     (calendar-islamic-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 dd-name
+                 (cdr (assoc-string dd-name
                                          (calendar-make-alist
                                           calendar-day-name-array
-                                          0 nil calendar-day-abbrev-array))))
+                                          0 nil calendar-day-abbrev-array) t)))
               (if mm-name
                   (setq mm (if (string-equal mm-name "*") 0
-                             (cdr (assoc-ignore-case
+                             (cdr (assoc-string
                                    mm-name
                                    (calendar-make-alist
-                                    calendar-islamic-month-name-array))))))
+                                    calendar-islamic-month-name-array) t)))))
               (mark-islamic-calendar-date-pattern mm dd yy)))))
       (setq d (cdr d)))))