diff options
| author | Richard M. Stallman | 2002-07-22 15:30:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-07-22 15:30:43 +0000 |
| commit | e0ab9b68c524894ba844a0b3cf0bb1b2dd9a120f (patch) | |
| tree | 473cd94c426adf51ef29d8c8fb342a8192fd3879 | |
| parent | 16cd607da77e5f8894b3cb65900b8c6035861fcf (diff) | |
| download | emacs-e0ab9b68c524894ba844a0b3cf0bb1b2dd9a120f.tar.gz emacs-e0ab9b68c524894ba844a0b3cf0bb1b2dd9a120f.zip | |
(diary-phases-of-moon): Add optional MARK
parameter, specifying what face or character to use in the
calendar display. These will now return (MARK . ENTRY).
| -rw-r--r-- | lisp/calendar/lunar.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el index a076f0b88c5..2a4666ba701 100644 --- a/lisp/calendar/lunar.el +++ b/lisp/calendar/lunar.el | |||
| @@ -236,8 +236,11 @@ This function is suitable for execution in a .emacs file." | |||
| 236 | (displayed-year (extract-calendar-year date))) | 236 | (displayed-year (extract-calendar-year date))) |
| 237 | (calendar-phases-of-moon)))) | 237 | (calendar-phases-of-moon)))) |
| 238 | 238 | ||
| 239 | (defun diary-phases-of-moon () | 239 | (defun diary-phases-of-moon (&optional mark) |
| 240 | "Moon phases diary entry." | 240 | "Moon phases diary entry. |
| 241 | |||
| 242 | An optional parameter MARK specifies a face or single-character string to | ||
| 243 | use when highlighting the day in the calendar." | ||
| 241 | (let* ((index (* 4 | 244 | (let* ((index (* 4 |
| 242 | (truncate | 245 | (truncate |
| 243 | (* 12.3685 | 246 | (* 12.3685 |
| @@ -250,8 +253,8 @@ This function is suitable for execution in a .emacs file." | |||
| 250 | (setq index (1+ index)) | 253 | (setq index (1+ index)) |
| 251 | (setq phase (lunar-phase index))) | 254 | (setq phase (lunar-phase index))) |
| 252 | (if (calendar-date-equal (car phase) date) | 255 | (if (calendar-date-equal (car phase) date) |
| 253 | (concat (lunar-phase-name (car (cdr (cdr phase)))) " " | 256 | (cons mark (concat (lunar-phase-name (car (cdr (cdr phase)))) " " |
| 254 | (car (cdr phase)))))) | 257 | (car (cdr phase))))))) |
| 255 | 258 | ||
| 256 | 259 | ||
| 257 | ;; For the Chinese calendar the calculations for the new moon need to be more | 260 | ;; For the Chinese calendar the calculations for the new moon need to be more |