changeset 92677:3f32c597cb6b

(diary-islamic-date): Move to end. (date, number): Declare where needed.
author Glenn Morris <rgm@gnu.org>
date Sun, 09 Mar 2008 03:42:58 +0000
parents 6984f0acb7d8
children a7290e24873c
files lisp/calendar/cal-islam.el
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-islam.el	Sun Mar 09 03:42:20 2008 +0000
+++ b/lisp/calendar/cal-islam.el	Sun Mar 09 03:42:58 2008 +0000
@@ -36,10 +36,8 @@
 
 ;;; Code:
 
-(defvar date)
 (defvar displayed-month)
 (defvar displayed-year)
-(defvar number)
 (defvar original-date)
 
 (require 'cal-julian)
@@ -171,13 +169,6 @@
                        (calendar-absolute-from-islamic date)))
   (or noecho (calendar-print-islamic-date)))
 
-(defun diary-islamic-date ()
-  "Islamic calendar equivalent of date diary entry."
-  (let ((i (calendar-islamic-date-string date)))
-    (if (string-equal i "")
-        "Date is pre-Islamic"
-      (format "Islamic date (until sunset): %s" i))))
-
 (defun holiday-islamic (month day string)
   "Holiday on MONTH, DAY (Islamic) called STRING.
 If MONTH, DAY (Islamic) is visible, the value returned is corresponding
@@ -202,6 +193,8 @@
 (declare-function add-to-diary-list "diary-lib"
                   (date string specifier &optional marker globcolor literal))
 
+(defvar number)                         ; from diary-list-entries
+
 (defun list-islamic-diary-entries ()
   "Add any Islamic date entries from the diary file to `diary-entries-list'.
 Islamic date diary entries must be prefaced by `islamic-diary-entry-symbol'
@@ -511,6 +504,16 @@
          (calendar-cursor-to-date t)))))
      arg)))
 
+(defvar date)
+
+;; To be called from diary-sexp-entry, where DATE, ENTRY are bound.
+(defun diary-islamic-date ()
+  "Islamic calendar equivalent of date diary entry."
+  (let ((i (calendar-islamic-date-string date)))
+    (if (string-equal i "")
+        "Date is pre-Islamic"
+      (format "Islamic date (until sunset): %s" i))))
+
 (provide 'cal-islam)
 
 ;; Local Variables: