(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."
(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."
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."
(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."
(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
(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
(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.
(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.
(- ; 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."
(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
(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
(require 'calendar)
+;;;###autoload
(defun calendar-goto-today ()
"Reposition the calendar window so the current date is visible."
(interactive)
(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."
(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
(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
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
(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
(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.
(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."
(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")
(+ (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")
(+ (- 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")
(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")
(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")
(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")
(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))
(- (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)))
(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."
(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
(provide 'cal-move)
+;; Local Variables:
+;; generated-autoload-file: "cal-loaddefs.el"
+;; End:
+
;; arch-tag: d0883c46-7e16-4914-8ff8-8f67e699b781
;;; cal-move.el ends here
(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."
(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."
(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
(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 ()
(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