summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2008-04-02 03:15:54 +0000
committerGlenn Morris <rgm@gnu.org>2008-04-02 03:15:54 +0000
commitd4ab8ae3c8de4de6403ef71d4f604a88953890ec (patch)
treef36ce8d5e97451cbc48df0dc55a65b70553128e4
parenta432c0a64b91d82814bea32b082fa5ce677155a8 (diff)
downloademacs-d4ab8ae3c8de4de6403ef71d4f604a88953890ec.tar.gz
(holiday-chinese-new-year): Use a single let.
-rw-r--r--lisp/calendar/cal-china.el21
1 files changed, 10 insertions, 11 deletions
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el
index 51ba42b9a8b..eb07e41477d 100644
--- a/lisp/calendar/cal-china.el
+++ b/lisp/calendar/cal-china.el
@@ -422,22 +422,21 @@ Gregorian date Sunday, December 31, 1 BC."
"Date of Chinese New Year, if visible in calendar.
Returns (((MONTH DAY YEAR) TEXT)), where the date is Gregorian."
(let ((m displayed-month)
- (y displayed-year))
+ (y displayed-year)
+ chinese-new-year)
;; In the Gregorian calendar, CNY falls between Jan 21 and Feb 20.
;; Jan is visible if displayed-month = 12, 1, 2; Feb if d-m = 1, 2, 3.
;; If we shift the calendar forward one month, we can do a
;; one-sided test, namely: d-m <= 4 means CNY might be visible.
(increment-calendar-month m y 1) ; shift forward a month
- (if (< m 5)
- (let ((chinese-new-year
- (calendar-gregorian-from-absolute
- (cadr (assoc 1 (chinese-year y))))))
- (if (calendar-date-is-visible-p chinese-new-year)
- (list
- (list chinese-new-year
- (format "Chinese New Year (%s)"
- (calendar-chinese-sexagesimal-name
- (+ y 57))))))))))
+ (and (< m 5)
+ (calendar-date-is-visible-p (setq chinese-new-year
+ (calendar-gregorian-from-absolute
+ (cadr (assoc 1 (chinese-year y))))))
+ (list
+ (list chinese-new-year
+ (format "Chinese New Year (%s)"
+ (calendar-chinese-sexagesimal-name (+ y 57))))))))
;;;###cal-autoload
(defun calendar-chinese-date-string (&optional date)