changeset 52119:226327fe046f

(displayed-month, displayed-year): Define for compiler. (calendar-islamic-month-name-array): Add doc string. (list-islamic-diary-entries): Adapt for new behaviours of `calendar-day-name' and `add-to-diary-list' functions. (mark-islamic-diary-entries): Adapt for new behaviours of `diary-name-pattern' and `calendar-make-alist' functions.
author Glenn Morris <rgm@gnu.org>
date Sun, 03 Aug 2003 14:02:15 +0000
parents af8f4ec2f255
children d03db605b057
files lisp/calendar/cal-islam.el
diffstat 1 files changed, 22 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-islam.el	Sun Aug 03 14:01:40 2003 +0000
+++ b/lisp/calendar/cal-islam.el	Sun Aug 03 14:02:15 2003 +0000
@@ -1,6 +1,6 @@
 ;;; cal-islam.el --- calendar functions for the Islamic calendar
 
-;; Copyright (C) 1995, 1997, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001, 2003 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Keywords: calendar
@@ -40,11 +40,15 @@
 
 ;;; Code:
 
+(defvar displayed-month)
+(defvar displayed-year)
+
 (require 'cal-julian)
 
 (defvar calendar-islamic-month-name-array
   ["Muharram" "Safar" "Rabi I" "Rabi II" "Jumada I" "Jumada II"
-   "Rajab" "Sha'ban" "Ramadan" "Shawwal" "Dhu al-Qada" "Dhu al-Hijjah"])
+   "Rajab" "Sha'ban" "Ramadan" "Shawwal" "Dhu al-Qada" "Dhu al-Hijjah"]
+"Array of strings giving the names of the Islamic months.")
 
 (defvar calendar-islamic-epoch (calendar-absolute-from-julian '(7 16 622))
   "Absolute date of start of Islamic calendar = August 29, 284 A.D. (Julian).")
@@ -221,9 +225,9 @@
                                  (car d)))
                     (backup (equal (car (car d)) 'backup))
                     (dayname
-                     (concat
-                      (calendar-day-name gdate) "\\|"
-                      (substring (calendar-day-name gdate) 0 3) ".?"))
+                     (format "%s\\|%s\\.?"
+                      (calendar-day-name gdate)
+                      (calendar-day-name gdate 'abbrev)))
                     (calendar-month-name-array
                      calendar-islamic-month-name-array)
                     (monthname
@@ -269,7 +273,8 @@
                         gdate
                         (buffer-substring-no-properties entry-start (point))
                         (buffer-substring-no-properties
-                         (1+ date-start) (1- entry-start)))))))
+                         (1+ date-start) (1- entry-start))
+                        (copy-marker entry-start))))))
                (setq d (cdr d))))
            (setq gdate
                  (calendar-gregorian-from-absolute
@@ -293,11 +298,11 @@
           ((date-form (if (equal (car (car d)) 'backup)
                           (cdr (car d))
                         (car d)));; ignore 'backup directive
-           (dayname (diary-name-pattern calendar-day-name-array))
+           (dayname (diary-name-pattern calendar-day-name-array
+                                        calendar-day-abbrev-array))
            (monthname
-            (concat
-             (diary-name-pattern calendar-islamic-month-name-array t)
-             "\\|\\*"))
+            (format "%s\\|\\*"
+                    (diary-name-pattern calendar-islamic-month-name-array)))
            (month "[0-9]+\\|\\*")
            (day "[0-9]+\\|\\*")
            (year "[0-9]+\\|\\*")
@@ -367,19 +372,16 @@
                          (string-to-int y-str)))))
             (if dd-name
                 (mark-calendar-days-named
-                 (cdr (assoc-ignore-case (substring dd-name 0 3)
+                 (cdr (assoc-ignore-case dd-name
                                          (calendar-make-alist
                                           calendar-day-name-array
-                                          0
-                                          '(lambda (x) (substring x 0 3))))))
+                                          0 nil calendar-day-abbrev-array))))
               (if mm-name
-                  (if (string-equal mm-name "*")
-                      (setq mm 0)
-                    (setq mm
-                          (cdr (assoc-ignore-case
-                                mm-name
-                                (calendar-make-alist
-                                  calendar-islamic-month-name-array))))))
+                  (setq mm (if (string-equal mm-name "*") 0
+                             (cdr (assoc-ignore-case
+                                   mm-name
+                                   (calendar-make-alist
+                                    calendar-islamic-month-name-array))))))
               (mark-islamic-calendar-date-pattern mm dd yy)))))
       (setq d (cdr d)))))