]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/cal-islam.el
(fancy-diary-display-mode): Bind "q" to `quit-window'
[gnu-emacs] / lisp / calendar / cal-islam.el
index 1949a6b48dd11638d1958f6674a10032ce8c0489..9ca2861e6b71395bb5e17c1c14880a5660d73112 100644 (file)
@@ -1,6 +1,6 @@
-;;; cal-islam.el --- calendar functions for the Islamic calendar.
+;;; cal-islam.el --- calendar functions for the Islamic calendar
 
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Keywords: calendar
 ;; This collection of functions implements the features of calendar.el and
 ;; 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).
+
 ;; Comments, corrections, and improvements should be sent to
 ;;  Edward M. Reingold               Department of Computer Science
 ;;  (217) 333-6733                   University of Illinois at Urbana-Champaign
@@ -146,13 +150,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
-                       (capitalize
+          (month (cdr (assoc-ignore-case
                         (completing-read
                          "Islamic calendar month name: "
                          (mapcar 'list (append month-array nil))
-                         nil t))
-                       (calendar-make-alist month-array 1 'capitalize))))
+                         nil t)
+                       (calendar-make-alist month-array 1))))
           (last (islamic-calendar-last-day-of-month month year))
           (day (calendar-read
                 (format "Islamic calendar day (1-%d): " last)
@@ -206,7 +209,7 @@ not be marked in the 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)
-                  (idate (calendar-islamic-from-absolute 
+                  (idate (calendar-islamic-from-absolute
                           (calendar-absolute-from-gregorian gdate)))
                   (month (extract-calendar-month idate))
                   (day (extract-calendar-day idate))
@@ -263,7 +266,10 @@ not be marked in the calendar.  This function is provided for use with the
                        (backward-char 1)
                        (subst-char-in-region date-start (point) ?\^M ?\n t)
                        (add-to-diary-list
-                         gdate (buffer-substring entry-start (point)))))))
+                        gdate
+                        (buffer-substring-no-properties entry-start (point))
+                        (buffer-substring-no-properties
+                         (1+ date-start) (1- entry-start)))))))
                (setq d (cdr d))))
            (setq gdate
                  (calendar-gregorian-from-absolute
@@ -361,17 +367,17 @@ provided for use as part of the nongregorian-diary-marking-hook."
                          (string-to-int y-str)))))
             (if dd-name
                 (mark-calendar-days-named
-                 (cdr (assoc (capitalize (substring dd-name 0 3))
-                             (calendar-make-alist
-                               calendar-day-name-array
-                               0
-                               '(lambda (x) (substring x 0 3))))))
+                 (cdr (assoc-ignore-case (substring dd-name 0 3)
+                                         (calendar-make-alist
+                                          calendar-day-name-array
+                                          0
+                                          '(lambda (x) (substring x 0 3))))))
               (if mm-name
                   (if (string-equal mm-name "*")
                       (setq mm 0)
                     (setq mm
-                          (cdr (assoc
-                                (capitalize mm-name)
+                          (cdr (assoc-ignore-case
+                                mm-name
                                 (calendar-make-alist
                                   calendar-islamic-month-name-array))))))
               (mark-islamic-calendar-date-pattern mm dd yy)))))
@@ -444,7 +450,7 @@ Prefix arg will make the entry nonmarking."
     (make-diary-entry
      (concat
       islamic-diary-entry-symbol
-      (calendar-date-string 
+      (calendar-date-string
        (calendar-islamic-from-absolute
         (calendar-absolute-from-gregorian
          (calendar-cursor-to-date t)))
@@ -462,7 +468,7 @@ Prefix arg will make the entry nonmarking."
     (make-diary-entry
      (concat
       islamic-diary-entry-symbol
-      (calendar-date-string 
+      (calendar-date-string
        (calendar-islamic-from-absolute
         (calendar-absolute-from-gregorian
          (calendar-cursor-to-date t)))))
@@ -481,7 +487,7 @@ Prefix arg will make the entry nonmarking."
     (make-diary-entry
      (concat
       islamic-diary-entry-symbol
-      (calendar-date-string 
+      (calendar-date-string
        (calendar-islamic-from-absolute
         (calendar-absolute-from-gregorian
          (calendar-cursor-to-date t)))))