From d383fd971c95b0bd45a75062cb5891c3a76bb947 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 8 Mar 2008 03:44:08 +0000 Subject: [PATCH] Unquote lambda functions. Add autoload cookies to functions formerly autoloaded in calendar.el. Set `generated-autoload-file' to "cal-loaddefs.el". --- lisp/calendar/cal-islam.el | 16 +++++++++++++--- lisp/calendar/cal-iso.el | 22 +++++++++++++++------- lisp/calendar/cal-julian.el | 21 +++++++++++++++++---- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el index 9e74b7d87af..b05f44868a8 100644 --- a/lisp/calendar/cal-islam.el +++ b/lisp/calendar/cal-islam.el @@ -119,6 +119,7 @@ Gregorian date Sunday, December 31, 1 BC." (1- (calendar-absolute-from-islamic (list month 1 year)))))) (list month day year)))) +;;;###autoload (defun calendar-islamic-date-string (&optional date) "String of Islamic date before sunset of Gregorian DATE. Returns the empty string if DATE is pre-Islamic. @@ -132,6 +133,7 @@ Driven by the variable `calendar-date-display-form'." "" (calendar-date-string islamic-date nil t)))) +;;;###autoload (defun calendar-print-islamic-date () "Show the Islamic calendar equivalent of the date under the cursor." (interactive) @@ -140,13 +142,14 @@ Driven by the variable `calendar-date-display-form'." (message "Date is pre-Islamic") (message "Islamic date (until sunset): %s" i)))) +;;;###autoload (defun calendar-goto-islamic-date (date &optional noecho) "Move cursor to Islamic DATE; echo Islamic date unless NOECHO is t." (interactive (let* ((today (calendar-current-date)) (year (calendar-read "Islamic calendar year (>0): " - '(lambda (x) (> x 0)) + (lambda (x) (> x 0)) (int-to-string (extract-calendar-year (calendar-islamic-from-absolute @@ -162,7 +165,7 @@ Driven by the variable `calendar-date-display-form'." (last (islamic-calendar-last-day-of-month month year)) (day (calendar-read (format "Islamic calendar day (1-%d): " last) - '(lambda (x) (and (< 0 x) (<= x last)))))) + (lambda (x) (and (< 0 x) (<= x last)))))) (list (list month day year)))) (calendar-goto-date (calendar-gregorian-from-absolute (calendar-absolute-from-islamic date))) @@ -452,6 +455,7 @@ A value of 0 in any position is a wildcard." (mark-visible-calendar-date (calendar-gregorian-from-absolute date))))))))) +;;;###autoload (defun insert-islamic-diary-entry (arg) "Insert a diary entry. For the Islamic date corresponding to the date indicated by point. @@ -468,6 +472,7 @@ Prefix arg will make the entry nonmarking." nil t)) arg))) +;;;###autoload (defun insert-monthly-islamic-diary-entry (arg) "Insert a monthly diary entry. For the day of the Islamic month corresponding to the date indicated by point. @@ -485,6 +490,7 @@ Prefix arg will make the entry nonmarking." (calendar-cursor-to-date t))))) arg))) +;;;###autoload (defun insert-yearly-islamic-diary-entry (arg) "Insert an annual diary entry. For the day of the Islamic year corresponding to the date indicated by point. @@ -506,5 +512,9 @@ Prefix arg will make the entry nonmarking." (provide 'cal-islam) -;;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7 +;; Local Variables: +;; generated-autoload-file: "cal-loaddefs.el" +;; End: + +;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7 ;;; cal-islam.el ends here diff --git a/lisp/calendar/cal-iso.el b/lisp/calendar/cal-iso.el index 7e2e91904e7..878953e9d85 100644 --- a/lisp/calendar/cal-iso.el +++ b/lisp/calendar/cal-iso.el @@ -36,8 +36,6 @@ ;;; Code: -(defvar date) - (require 'calendar) (defun calendar-absolute-from-iso (date) @@ -54,7 +52,7 @@ Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary." (+ (calendar-dayname-on-or-before 1 (+ 3 (calendar-absolute-from-gregorian (list 1 1 year)))) (* 7 (1- week)) - (if (= day 0) 6 (1- day))))) + (if (zerop day) 6 (1- day))))) (defun calendar-iso-from-absolute (date) "Compute the `ISO commercial date' corresponding to the absolute DATE. @@ -76,6 +74,7 @@ date Sunday, December 31, 1 BC." (% date 7) year))) +;;;###autoload (defun calendar-iso-date-string (&optional date) "String of ISO date of Gregorian DATE. Defaults to today's date if DATE is not given." @@ -88,6 +87,7 @@ Defaults to today's date if DATE is not given." (extract-calendar-month iso-date) (extract-calendar-year iso-date)))) +;;;###autoload (defun calendar-print-iso-date () "Show equivalent ISO date for the date under the cursor." (interactive) @@ -99,7 +99,7 @@ Defaults to today's date if DATE is not given." (let* ((today (calendar-current-date)) (year (calendar-read "ISO calendar year (>0): " - '(lambda (x) (> x 0)) + (lambda (x) (> x 0)) (int-to-string (extract-calendar-year today)))) (no-weeks (extract-calendar-month (calendar-iso-from-absolute @@ -109,13 +109,14 @@ Defaults to today's date if DATE is not given." (list 1 4 (1+ year)))))))) (week (calendar-read (format "ISO calendar week (1-%d): " no-weeks) - '(lambda (x) (and (> x 0) (<= x no-weeks))))) + (lambda (x) (and (> x 0) (<= x no-weeks))))) (day (if dayflag (calendar-read "ISO day (1-7): " - '(lambda (x) (and (<= 1 x) (<= x 7)))) + (lambda (x) (and (<= 1 x) (<= x 7)))) 1))) (list (list week day year)))) +;;;###autoload (defun calendar-goto-iso-date (date &optional noecho) "Move cursor to ISO DATE; echo ISO date unless NOECHO is t." (interactive (calendar-iso-read-args t)) @@ -123,6 +124,7 @@ Defaults to today's date if DATE is not given." (calendar-absolute-from-iso date))) (or noecho (calendar-print-iso-date))) +;;;###autoload (defun calendar-goto-iso-week (date &optional noecho) "Move cursor to ISO DATE; echo ISO date unless NOECHO is t. Interactively, goes to the first day of the specified week." @@ -131,11 +133,17 @@ Interactively, goes to the first day of the specified week." (calendar-absolute-from-iso date))) (or noecho (calendar-print-iso-date))) +(defvar date) + (defun diary-iso-date () "ISO calendar equivalent of date diary entry." (format "ISO date: %s" (calendar-iso-date-string date))) (provide 'cal-iso) -;;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6 +;; Local Variables: +;; generated-autoload-file: "cal-loaddefs.el" +;; End: + +;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6 ;;; cal-iso.el ends here diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el index ef7ad67272b..f033e6864d9 100644 --- a/lisp/calendar/cal-julian.el +++ b/lisp/calendar/cal-julian.el @@ -42,6 +42,7 @@ (require 'calendar) +;;;###autoload (defun calendar-julian-from-absolute (date) "Compute the Julian (month day year) corresponding to the absolute DATE. The absolute date is the number of days elapsed since the (imaginary) @@ -82,6 +83,7 @@ The Gregorian date Sunday, December 31, 1 BC is imaginary." (/ (1- year) 4) -2))) +;;;###autoload (defun calendar-julian-date-string (&optional date) "String of Julian date of Gregorian DATE. Defaults to today's date if DATE is not given. @@ -92,19 +94,21 @@ Driven by the variable `calendar-date-display-form'." (or date (calendar-current-date)))) nil t)) +;;;###autoload (defun calendar-print-julian-date () "Show the Julian calendar equivalent of the date under the cursor." (interactive) (message "Julian date: %s" (calendar-julian-date-string (calendar-cursor-to-date t)))) +;;;###autoload (defun calendar-goto-julian-date (date &optional noecho) "Move cursor to Julian DATE; echo Julian date unless NOECHO is t." (interactive (let* ((today (calendar-current-date)) (year (calendar-read "Julian calendar year (>0): " - '(lambda (x) (> x 0)) + (lambda (x) (> x 0)) (int-to-string (extract-calendar-year (calendar-julian-from-absolute @@ -125,7 +129,7 @@ Driven by the variable `calendar-date-display-form'." (day (calendar-read (format "Julian calendar day (%d-%d): " (if (and (= year 1) (= month 1)) 3 1) last) - '(lambda (x) + (lambda (x) (and (< (if (and (= year 1) (= month 1)) 2 0) x) (<= x last)))))) (list (list month day year)))) @@ -164,14 +168,17 @@ nil if it is not visible in the current calendar window." "Julian calendar equivalent of date diary entry." (format "Julian date: %s" (calendar-julian-date-string date))) +;;;###autoload (defun calendar-absolute-from-astro (d) "Absolute date of astronomical (Julian) day number D." (- d 1721424.5)) +;;;###autoload (defun calendar-astro-from-absolute (d) "Astronomical (Julian) day number of absolute date D." (+ d 1721424.5)) +;;;###autoload (defun calendar-astro-date-string (&optional date) "String of astronomical (Julian) day number after noon UTC of Gregorian DATE. Defaults to today's date if DATE is not given." @@ -181,6 +188,7 @@ Defaults to today's date if DATE is not given." (calendar-absolute-from-gregorian (or date (calendar-current-date))))))) +;;;###autoload (defun calendar-print-astro-day-number () "Show astronomical (Julian) day number after noon UTC on date shown by cursor." (interactive) @@ -188,12 +196,13 @@ Defaults to today's date if DATE is not given." "Astronomical (Julian) day number (at noon UTC): %s.0" (calendar-astro-date-string (calendar-cursor-to-date t)))) +;;;###autoload (defun calendar-goto-astro-day-number (daynumber &optional noecho) "Move cursor to astronomical (Julian) DAYNUMBER. Echo astronomical (Julian) day number unless NOECHO is t." (interactive (list (calendar-read "Astronomical (Julian) day number (>1721425): " - '(lambda (x) (> x 1721425))))) + (lambda (x) (> x 1721425))))) (calendar-goto-date (calendar-gregorian-from-absolute (floor @@ -207,5 +216,9 @@ Echo astronomical (Julian) day number unless NOECHO is t." (provide 'cal-julian) -;;; arch-tag: 0520acdd-1c60-4188-9aa8-9b8c24d856ae +;; Local Variables: +;; generated-autoload-file: "cal-loaddefs.el" +;; End: + +;; arch-tag: 0520acdd-1c60-4188-9aa8-9b8c24d856ae ;;; cal-julian.el ends here -- 2.39.2