Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
45cb347b
Commit
45cb347b
authored
Jan 30, 1994
by
Richard M. Stallman
Browse files
(calendar-mayan-date-string): New function.
(calendar-print-mayan-date, diary-mayan-date): Use it.
parent
adaeaa8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
lisp/calendar/cal-mayan.el
lisp/calendar/cal-mayan.el
+17
-17
No files found.
lisp/calendar/cal-mayan.el
View file @
45cb347b
...
...
@@ -328,19 +328,26 @@ Long count is a list (baktun katun tun uinal kin)"
(
-
; days before absolute date 0
calendar-mayan-days-before-absolute-zero
)))
(
defun
calendar-mayan-date-string
(
&optional
date
)
"String of Mayan date of Gregorian DATE.
Defaults to today's date if DATE is not given."
(
let*
((
d
(
calendar-absolute-from-gregorian
(
or
date
(
calendar-current-date
))))
(
tzolkin
(
calendar-mayan-tzolkin-from-absolute
d
))
(
haab
(
calendar-mayan-haab-from-absolute
d
))
(
long-count
(
calendar-mayan-long-count-from-absolute
d
)))
(
format
"Long count = %s; tzolkin = %s; haab = %s"
(
calendar-mayan-long-count-to-string
long-count
)
(
calendar-mayan-tzolkin-to-string
tzolkin
)
(
calendar-mayan-haab-to-string
haab
))))
(
defun
calendar-print-mayan-date
()
"Show the Mayan long count, tzolkin, and haab equivalents of date."
(
interactive
)
(
let*
((
d
(
calendar-absolute-from-gregorian
(
message
"Mayan date: %s"
(
calendar-mayan-date-string
(
or
(
calendar-cursor-to-date
)
(
error
"Cursor is not on a date!"
))))
(
tzolkin
(
calendar-mayan-tzolkin-from-absolute
d
))
(
haab
(
calendar-mayan-haab-from-absolute
d
))
(
long-count
(
calendar-mayan-long-count-from-absolute
d
)))
(
message
"Mayan date: Long count = %s; tzolkin = %s; haab = %s"
(
calendar-mayan-long-count-to-string
long-count
)
(
calendar-mayan-tzolkin-to-string
tzolkin
)
(
calendar-mayan-haab-to-string
haab
))))
(
error
"Cursor is not on a date!"
)))))
(
defun
calendar-goto-mayan-long-count-date
(
date
&optional
noecho
)
"Move cursor to Mayan long count DATE. Echo Mayan date unless NOECHO is t."
...
...
@@ -372,14 +379,7 @@ Long count is a list (baktun katun tun uinal kin)"
(
defun
diary-mayan-date
()
"Show the Mayan long count, haab, and tzolkin dates as a diary entry."
(
let*
((
d
(
calendar-absolute-from-gregorian
date
))
(
tzolkin
(
calendar-mayan-tzolkin-from-absolute
d
))
(
haab
(
calendar-mayan-haab-from-absolute
d
))
(
long-count
(
calendar-mayan-long-count-from-absolute
d
)))
(
format
"Mayan date: Long count = %s; tzolkin = %s; haab = %s"
(
calendar-mayan-long-count-to-string
long-count
)
(
calendar-mayan-tzolkin-to-string
haab
)
(
calendar-mayan-haab-to-string
tzolkin
))))
(
format
"Mayan date: %s"
(
calendar-mayan-date-string
date
)))
(
provide
'cal-mayan
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment