Commit 5942f9af authored by Glenn Morris's avatar Glenn Morris

Unquote lambda functions. Add autoload cookies to functions formerly

autoloaded in calendar.el.  Set `generated-autoload-file' to
"cal-loaddefs.el".
parent 3627d02d
......@@ -138,6 +138,7 @@ but some use 1137140. Using 1232041 gives you Spinden's correlation; using
(calendar-mayan-haab-from-absolute 0) haab-date))
365)))
;;;###autoload
(defun calendar-next-haab-date (haab-date &optional noecho)
"Move cursor to next instance of Mayan HAAB-DATE.
Echo Mayan date if NOECHO is t."
......@@ -150,6 +151,7 @@ Echo Mayan date if NOECHO is t."
(calendar-absolute-from-gregorian (calendar-cursor-to-date))))))
(or noecho (calendar-print-mayan-date)))
;;;###autoload
(defun calendar-previous-haab-date (haab-date &optional noecho)
"Move cursor to previous instance of Mayan HAAB-DATE.
Echo Mayan date if NOECHO is t."
......@@ -200,6 +202,7 @@ Echo Mayan date if NOECHO is t."
tzolkin-date))
260)))
;;;###autoload
(defun calendar-next-tzolkin-date (tzolkin-date &optional noecho)
"Move cursor to next instance of Mayan TZOLKIN-DATE.
Echo Mayan date if NOECHO is t."
......@@ -212,6 +215,7 @@ Echo Mayan date if NOECHO is t."
(calendar-absolute-from-gregorian (calendar-cursor-to-date))))))
(or noecho (calendar-print-mayan-date)))
;;;###autoload
(defun calendar-previous-tzolkin-date (tzolkin-date &optional noecho)
"Move cursor to previous instance of Mayan TZOLKIN-DATE.
Echo Mayan date if NOECHO is t."
......@@ -254,7 +258,7 @@ Returns nil if such a tzolkin-haab combination is impossible."
(let* ((completion-ignore-case t)
(haab-day (calendar-read
"Haab kin (0-19): "
'(lambda (x) (and (>= x 0) (< x 20)))))
(lambda (x) (and (>= x 0) (< x 20)))))
(haab-month-list (append calendar-mayan-haab-month-name-array
(and (< haab-day 5) '("Uayeb"))))
(haab-month (cdr
......@@ -270,7 +274,7 @@ Returns nil if such a tzolkin-haab combination is impossible."
(let* ((completion-ignore-case t)
(tzolkin-count (calendar-read
"Tzolkin kin (1-13): "
'(lambda (x) (and (> x 0) (< x 14)))))
(lambda (x) (and (> x 0) (< x 14)))))
(tzolkin-name-list (append calendar-mayan-tzolkin-names-array nil))
(tzolkin-name (cdr
(assoc-string
......@@ -280,6 +284,7 @@ Returns nil if such a tzolkin-haab combination is impossible."
(calendar-make-alist tzolkin-name-list 1) t))))
(cons tzolkin-count tzolkin-name)))
;;;###autoload
(defun calendar-next-calendar-round-date
(tzolkin-date haab-date &optional noecho)
"Move cursor to next instance of Mayan HAAB-DATE TZOLKIN-DATE combination.
......@@ -297,6 +302,7 @@ Echo Mayan date if NOECHO is t."
(calendar-goto-date (calendar-gregorian-from-absolute date))
(or noecho (calendar-print-mayan-date)))))
;;;###autoload
(defun calendar-previous-calendar-round-date
(tzolkin-date haab-date &optional noecho)
"Move to previous instance of Mayan TZOLKIN-DATE HAAB-DATE combination.
......@@ -325,6 +331,7 @@ Long count is a list (baktun katun tun uinal kin)"
(- ; days before absolute date 0
calendar-mayan-days-before-absolute-zero)))
;;;###autoload
(defun calendar-mayan-date-string (&optional date)
"String of Mayan date of Gregorian DATE.
Defaults to today's date if DATE is not given."
......@@ -338,12 +345,14 @@ Defaults to today's date if DATE is not given."
(calendar-mayan-tzolkin-to-string tzolkin)
(calendar-mayan-haab-to-string haab))))
;;;###autoload
(defun calendar-print-mayan-date ()
"Show the Mayan long count, tzolkin, and haab equivalents of date."
(interactive)
(message "Mayan date: %s"
(calendar-mayan-date-string (calendar-cursor-to-date t))))
;;;###autoload
(defun calendar-goto-mayan-long-count-date (date &optional noecho)
"Move cursor to Mayan long count DATE. Echo Mayan date unless NOECHO is t."
(interactive
......@@ -378,5 +387,9 @@ Defaults to today's date if DATE is not given."
(provide 'cal-mayan)
;;; arch-tag: 54f35144-cd0f-4873-935a-a60129de07df
;; Local Variables:
;; generated-autoload-file: "cal-loaddefs.el"
;; End:
;; arch-tag: 54f35144-cd0f-4873-935a-a60129de07df
;;; cal-mayan.el ends here
......@@ -37,6 +37,7 @@
(require 'calendar)
;;;###autoload
(defun calendar-goto-today ()
"Reposition the calendar window so the current date is visible."
(interactive)
......@@ -47,6 +48,7 @@
(calendar-cursor-to-visible-date today)))
(run-hooks 'calendar-move-hook))
;;;###autoload
(defun calendar-forward-month (arg)
"Move the cursor forward ARG months.
Movement is backward if ARG is negative."
......@@ -67,24 +69,28 @@ Movement is backward if ARG is negative."
(calendar-cursor-to-visible-date new-cursor-date)))
(run-hooks 'calendar-move-hook))
;;;###autoload
(defun calendar-forward-year (arg)
"Move the cursor forward by ARG years.
Movement is backward if ARG is negative."
(interactive "p")
(calendar-forward-month (* 12 arg)))
;;;###autoload
(defun calendar-backward-month (arg)
"Move the cursor backward by ARG months.
Movement is forward if ARG is negative."
(interactive "p")
(calendar-forward-month (- arg)))
;;;###autoload
(defun calendar-backward-year (arg)
"Move the cursor backward ARG years.
Movement is forward is ARG is negative."
(interactive "p")
(calendar-forward-month (* -12 arg)))
;;;###autoload
(defun calendar-scroll-left (&optional arg event)
"Scroll the displayed calendar left by ARG months.
If ARG is negative the calendar is scrolled right. Maintains the relative
......@@ -109,6 +115,7 @@ position of the cursor with respect to the calendar as well as possible."
(t (list month 1 year)))))))
(run-hooks 'calendar-move-hook)))
;;;###autoload
(defun calendar-scroll-right (&optional arg event)
"Scroll the displayed calendar window right by ARG months.
If ARG is negative the calendar is scrolled left. Maintains the relative
......@@ -117,6 +124,7 @@ position of the cursor with respect to the calendar as well as possible."
last-nonmenu-event))
(calendar-scroll-left (- (or arg 1)) event))
;;;###autoload
(defun calendar-scroll-left-three-months (arg)
"Scroll the displayed calendar window left by 3*ARG months.
If ARG is negative the calendar is scrolled right. Maintains the relative
......@@ -124,6 +132,7 @@ position of the cursor with respect to the calendar as well as possible."
(interactive "p")
(calendar-scroll-left (* 3 arg)))
;;;###autoload
(defun calendar-scroll-right-three-months (arg)
"Scroll the displayed calendar window right by 3*ARG months.
If ARG is negative the calendar is scrolled left. Maintains the relative
......@@ -131,6 +140,7 @@ position of the cursor with respect to the calendar as well as possible."
(interactive "p")
(calendar-scroll-left (* -3 arg)))
;;;###autoload
(defun calendar-cursor-to-nearest-date ()
"Move the cursor to the closest date.
The position of the cursor is unchanged if it is already on a date.
......@@ -156,6 +166,7 @@ Returns the list (month day year) giving the cursor position."
(re-search-backward "[0-9]" nil t)))
(calendar-cursor-to-date))))
;;;###autoload
(defun calendar-forward-day (arg)
"Move the cursor forward ARG days.
Moves backward if ARG is negative."
......@@ -178,24 +189,28 @@ Moves backward if ARG is negative."
(calendar-cursor-to-visible-date new-cursor-date)))
(run-hooks 'calendar-move-hook))
;;;###autoload
(defun calendar-backward-day (arg)
"Move the cursor back ARG days.
Moves forward if ARG is negative."
(interactive "p")
(calendar-forward-day (- arg)))
;;;###autoload
(defun calendar-forward-week (arg)
"Move the cursor forward ARG weeks.
Moves backward if ARG is negative."
(interactive "p")
(calendar-forward-day (* arg 7)))
;;;###autoload
(defun calendar-backward-week (arg)
"Move the cursor back ARG weeks.
Moves forward if ARG is negative."
(interactive "p")
(calendar-forward-day (* arg -7)))
;;;###autoload
(defun calendar-beginning-of-week (arg)
"Move the cursor back ARG calendar-week-start-day's."
(interactive "p")
......@@ -207,6 +222,7 @@ Moves forward if ARG is negative."
(+ (mod (- day calendar-week-start-day) 7)
(* 7 (1- arg)))))))
;;;###autoload
(defun calendar-end-of-week (arg)
"Move the cursor forward ARG calendar-week-start-day+6's."
(interactive "p")
......@@ -218,6 +234,7 @@ Moves forward if ARG is negative."
(+ (- 6 (mod (- day calendar-week-start-day) 7))
(* 7 (1- arg)))))))
;;;###autoload
(defun calendar-beginning-of-month (arg)
"Move the cursor backward ARG month beginnings."
(interactive "p")
......@@ -231,6 +248,7 @@ Moves forward if ARG is negative."
(calendar-cursor-to-visible-date (list month 1 year))
(calendar-backward-month (1- arg)))))
;;;###autoload
(defun calendar-end-of-month (arg)
"Move the cursor forward ARG month ends."
(interactive "p")
......@@ -254,6 +272,7 @@ Moves forward if ARG is negative."
(calendar-cursor-to-visible-date last-day))))
(run-hooks 'calendar-move-hook))
;;;###autoload
(defun calendar-beginning-of-year (arg)
"Move the cursor backward ARG year beginnings."
(interactive "p")
......@@ -273,6 +292,7 @@ Moves forward if ARG is negative."
(calendar-cursor-to-visible-date (list 1 1 displayed-year)))))
(run-hooks 'calendar-move-hook))
;;;###autoload
(defun calendar-end-of-year (arg)
"Move the cursor forward ARG year beginnings."
(interactive "p")
......@@ -292,6 +312,7 @@ Moves forward if ARG is negative."
(calendar-cursor-to-visible-date (list 12 31 displayed-year)))))
(run-hooks 'calendar-move-hook))
;;;###autoload
(defun calendar-cursor-to-visible-date (date)
"Move the cursor to DATE that is on the screen."
(let* ((month (extract-calendar-month date))
......@@ -313,7 +334,7 @@ Moves forward if ARG is negative."
(- (calendar-day-of-week date)
calendar-week-start-day)
7))))))
;;;###autoload
(defun calendar-goto-date (date)
"Move cursor to DATE."
(interactive (list (calendar-read-date)))
......@@ -328,6 +349,7 @@ Moves forward if ARG is negative."
(calendar-cursor-to-visible-date date)
(run-hooks 'calendar-move-hook))
;;;###autoload
(defun calendar-goto-day-of-year (year day &optional noecho)
"Move cursor to YEAR, DAY number; echo DAY/YEAR unless NOECHO is t.
Negative DAY counts backward from end of year."
......@@ -340,7 +362,7 @@ Negative DAY counts backward from end of year."
(last (if (calendar-leap-year-p year) 366 365))
(day (calendar-read
(format "Day number (+/- 1-%d): " last)
'(lambda (x) (and (<= 1 (abs x)) (<= (abs x) last))))))
(lambda (x) (and (<= 1 (abs x)) (<= (abs x) last))))))
(list year day)))
(calendar-goto-date
(calendar-gregorian-from-absolute
......@@ -361,5 +383,9 @@ Negative DAY counts backward from end of year."
(provide 'cal-move)
;; Local Variables:
;; generated-autoload-file: "cal-loaddefs.el"
;; End:
;; arch-tag: d0883c46-7e16-4914-8ff8-8f67e699b781
;;; cal-move.el ends here
......@@ -140,6 +140,7 @@ Gregorian date Sunday, December 31, 1 BC."
(list month 1 year))))))
(list month day year)))
;;;###autoload
(defun calendar-persian-date-string (&optional date)
"String of Persian date of Gregorian DATE.
Defaults to today's date if DATE is not given."
......@@ -155,12 +156,14 @@ Defaults to today's date if DATE is not given."
(year (int-to-string y)))
(mapconcat 'eval calendar-date-display-form ""))))
;;;###autoload
(defun calendar-print-persian-date ()
"Show the Persian calendar equivalent of the selected date."
(interactive)
(message "Persian date: %s"
(calendar-persian-date-string (calendar-cursor-to-date t))))
;;;###autoload
(defun calendar-goto-persian-date (date &optional noecho)
"Move cursor to Persian date DATE.
Echo Persian date unless NOECHO is t."
......@@ -174,7 +177,7 @@ Echo Persian date unless NOECHO is t."
(let* ((today (calendar-current-date))
(year (calendar-read
"Persian calendar year (not 0): "
'(lambda (x) (/= x 0))
(lambda (x) (/= x 0))
(int-to-string
(extract-calendar-year
(calendar-persian-from-absolute
......@@ -191,7 +194,7 @@ Echo Persian date unless NOECHO is t."
(last (persian-calendar-last-day-of-month month year))
(day (calendar-read
(format "Persian calendar day (1-%d): " last)
'(lambda (x) (and (< 0 x) (<= x last))))))
(lambda (x) (and (< 0 x) (<= x last))))))
(list (list month day year))))
(defun diary-persian-date ()
......@@ -200,5 +203,9 @@ Echo Persian date unless NOECHO is t."
(provide 'cal-persia)
;;; arch-tag: 2832383c-e4b4-4dc2-8ee9-cfbdd53e5e2d
;; Local Variables:
;; generated-autoload-file: "cal-loaddefs.el"
;; End:
;; arch-tag: 2832383c-e4b4-4dc2-8ee9-cfbdd53e5e2d
;;; cal-persia.el ends here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment