Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
589117b4
Commit
589117b4
authored
Apr 01, 2008
by
Glenn Morris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(holiday-julian): Use calendar-nongregorian-visible-p.
parent
2f264ff6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
38 deletions
+9
-38
lisp/calendar/cal-julian.el
lisp/calendar/cal-julian.el
+9
-38
No files found.
lisp/calendar/cal-julian.el
View file @
589117b4
...
...
@@ -128,50 +128,21 @@ Driven by the variable `calendar-date-display-form'."
(
calendar-absolute-from-julian
date
)))
(
or
noecho
(
calendar-print-julian-date
)))
(
defvar
displayed-month
)
(
defvar
displayed-year
)
;;;###holiday-autoload
(
defun
holiday-julian
(
month
day
string
)
"Holiday on MONTH, DAY (Julian) called STRING.
If MONTH, DAY (Julian) is visible, the value returned is corresponding
Gregorian date in the form of the list (((month day year) STRING)). Returns
nil if it is not visible in the current calendar window."
;; We need to choose the Julian year associated with month and day
;; that might make them visible.
;; This is the same as holiday-hebrew, except that the test for
;; which year to use is different.
(
let*
((
m1
displayed-month
)
(
y1
displayed-year
)
(
m2
displayed-month
)
(
y2
displayed-year
)
;; Absolute date of first/last dates in calendar window.
(
start-date
(
progn
(
increment-calendar-month
m1
y1
-1
)
(
calendar-absolute-from-gregorian
(
list
m1
1
y1
))))
(
end-date
(
progn
(
increment-calendar-month
m2
y2
1
)
(
calendar-absolute-from-gregorian
(
list
m2
(
calendar-last-day-of-month
m2
y2
)
y2
))))
;; Julian date of first/last date in calendar window.
(
julian-start
(
calendar-julian-from-absolute
start-date
))
(
julian-end
(
calendar-julian-from-absolute
end-date
))
;; Julian year of first/last dates.
;; Can only differ if displayed-month = 12, 1, 2.
(
julian-y1
(
extract-calendar-year
julian-start
))
(
julian-y2
(
extract-calendar-year
julian-end
))
;; Choose which year might be visible in the window.
;; Obviously it only matters when y1 and y2 differ, ie
;; when the _Julian_ new year is visible.
;; In the Gregorian case, we'd use y1 (the lower year)
;; when month >= 11. In the Julian case, there is an offset
;; of two weeks (ie 1 Nov Greg = 19 Oct Julian). So we use
;; month >= 10, since it can't cause any problems.
(
year
(
if
(
>
month
9
)
julian-y1
julian-y2
))
(
date
(
calendar-gregorian-from-absolute
(
calendar-absolute-from-julian
(
list
month
day
year
)))))
(
if
(
calendar-date-is-visible-p
date
)
(
list
(
list
date
string
)))))
(
let
((
gdate
(
calendar-nongregorian-visible-p
month
day
'calendar-absolute-from-julian
'calendar-julian-from-absolute
;; In the Gregorian case, we'd use the lower year when
;; month >= 11. In the Julian case, there is an offset
;; of two weeks (ie 1 Nov Greg = 19 Oct Julian). So we
;; use month >= 10, since it can't cause any problems.
(
lambda
(
m
)
(
<
m
10
)))))
(
if
gdate
(
list
(
list
gdate
string
)))))
;;;###cal-autoload
(
defun
calendar-absolute-from-astro
(
d
)
...
...
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