;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; solar.el Sunrise/sunset, equinoxes/solstices
;; Technical details of all the calendrical calculations can be found in
-;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold,
-;; Cambridge University Press (1997).
+;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
+;; and Nachum Dershowitz, Cambridge University Press (2001).
;; An earlier version of the technical details appeared in
;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold,
;; Software--Practice and Experience, Volume 20, Number 9 (September, 1990),
-;; pages 899-928. ``Calendrical Calculations, Part II: Three Historical
+;; pages 899-928, and in ``Calendrical Calculations, Part II: Three Historical
;; Calendars'' by E. M. Reingold, N. Dershowitz, and S. M. Clamen,
;; Software--Practice and Experience, Volume 23, Number 4 (April, 1993),
;; pages 383-404.
:type 'boolean
:group 'view)
-(defvar diary-face 'diary-face
+(defvar diary-face 'diary
"Face name to use for diary entries.")
-(defface diary-face
- '((((class color) (background light))
+(defface diary
+ '((((min-colors 88) (class color) (background light))
+ :foreground "red1")
+ (((class color) (background light))
:foreground "red")
+ (((min-colors 88) (class color) (background dark))
+ :foreground "yellow1")
(((class color) (background dark))
:foreground "yellow")
(t
:weight bold))
"Face for highlighting diary entries."
:group 'diary)
+;; backward-compatibility alias
+(put 'diary-face 'face-alias 'diary)
-(defface calendar-today-face
+(defface calendar-today
'((t (:underline t)))
"Face for indicating today's date."
:group 'diary)
+;; backward-compatibility alias
+(put 'calendar-today-face 'face-alias 'calendar-today)
-(defface holiday-face
+(defface holiday
'((((class color) (background light))
:background "pink")
(((class color) (background dark))
:inverse-video t))
"Face for indicating dates that have holidays."
:group 'diary)
+;; backward-compatibility alias
+(put 'holiday-face 'face-alias 'holiday)
(eval-after-load "facemenu"
'(progn
- (add-to-list 'facemenu-unlisted-faces 'diary-face)
- (add-to-list 'facemenu-unlisted-faces 'calendar-today-face)
- (add-to-list 'facemenu-unlisted-faces 'holiday-face)))
+ (add-to-list 'facemenu-unlisted-faces 'diary)
+ (add-to-list 'facemenu-unlisted-faces 'calendar-today)
+ (add-to-list 'facemenu-unlisted-faces 'holiday)))
(defcustom diary-entry-marker
(if (not (display-color-p))
"+"
- 'diary-face)
+ 'diary)
"*How to mark dates that have diary entries.
The value can be either a single-character string or a face."
:type '(choice string face)
(defcustom calendar-today-marker
(if (not (display-color-p))
"="
- 'calendar-today-face)
+ 'calendar-today)
"*How to mark today's date in the calendar.
The value can be either a single-character string or a face.
Marking today's date is done only if you set up `today-visible-calendar-hook'
(defcustom calendar-holiday-marker
(if (not (display-color-p))
"*"
- 'holiday-face)
+ 'holiday)
"*How to mark notable dates in the calendar.
The value can be either a single-character string or a face."
:type '(choice string face)
t)
(autoload 'calendar-goto-hebrew-date "cal-hebrew"
- "Move cursor to Hebrew date date."
+ "Move cursor to Hebrew date."
t)
(autoload 'calendar-print-hebrew-date "cal-hebrew"
t)
(autoload 'calendar-goto-coptic-date "cal-coptic"
- "Move cursor to Coptic date date."
+ "Move cursor to Coptic date."
t)
(autoload 'calendar-print-coptic-date "cal-coptic"
t)
(autoload 'calendar-goto-ethiopic-date "cal-coptic"
- "Move cursor to Ethiopic date date."
+ "Move cursor to Ethiopic date."
t)
(autoload 'calendar-print-ethiopic-date "cal-coptic"
t)
(autoload 'calendar-goto-persian-date "cal-persia"
- "Move cursor to Persian date date."
+ "Move cursor to Persian date."
t)
(autoload 'calendar-print-persian-date "cal-persia"
calendar-mode-map global-map)
(setq l (cdr l))))
(define-key calendar-mode-map "-" 'negative-argument)
+ (define-key calendar-mode-map ">" 'scroll-calendar-right)
(define-key calendar-mode-map "\C-x>" 'scroll-calendar-right)
(define-key calendar-mode-map [prior] 'scroll-calendar-right-three-months)
(define-key calendar-mode-map "\ev" 'scroll-calendar-right-three-months)
+ (define-key calendar-mode-map "<" 'scroll-calendar-left)
(define-key calendar-mode-map "\C-x<" 'scroll-calendar-left)
(define-key calendar-mode-map [next] 'scroll-calendar-left-three-months)
(define-key calendar-mode-map "\C-v" 'scroll-calendar-left-three-months)
(propertize (substitute-command-keys
"\\<calendar-mode-map>\\[scroll-calendar-left]")
'help-echo "mouse-2: scroll left"
+ 'mouse-face 'mode-line-highlight
'keymap (make-mode-line-mouse-map 'mouse-2
'mouse-scroll-calendar-left))
"Calendar"
(substitute-command-keys
"\\<calendar-mode-map>\\[calendar-goto-info-node] info")
'help-echo "mouse-2: read Info on Calendar"
+ 'mouse-face 'mode-line-highlight
'keymap (make-mode-line-mouse-map 'mouse-2 'calendar-goto-info-node))
"/"
(propertize
(substitute-command-keys
"\\<calendar-mode-map>\\[calendar-other-month] other")
'help-echo "mouse-2: choose another month"
+ 'mouse-face 'mode-line-highlight
'keymap (make-mode-line-mouse-map
'mouse-2 'mouse-calendar-other-month))
"/"
(substitute-command-keys
"\\<calendar-mode-map>\\[calendar-goto-today] today")
'help-echo "mouse-2: go to today's date"
+ 'mouse-face 'mode-line-highlight
'keymap (make-mode-line-mouse-map 'mouse-2 #'calendar-goto-today)))
'(calendar-date-string (calendar-current-date) t)
(propertize (substitute-command-keys
"\\<calendar-mode-map>\\[scroll-calendar-right]")
'help-echo "mouse-2: scroll right"
+ 'mouse-face 'mode-line-highlight
'keymap (make-mode-line-mouse-map
'mouse-2 'mouse-scroll-calendar-right)))
"The mode line of the calendar buffer.
\\<calendar-mode-map>\\[calendar-goto-info-node] from within the calendar.
\\<calendar-mode-map>\\{calendar-mode-map}"
-
(kill-all-local-variables)
(setq major-mode 'calendar-mode)
(setq mode-name "Calendar")
(make-local-variable 'displayed-month);; Month in middle of window.
(make-local-variable 'displayed-year) ;; Year in middle of window.
(set (make-local-variable 'font-lock-defaults)
- '(calendar-font-lock-keywords t)))
+ '(calendar-font-lock-keywords t))
+ (run-mode-hooks 'calendar-mode-hook))
(defun calendar-string-spread (strings char length)
"Concatenate list of STRINGS separated with copies of CHAR to fill LENGTH.
(if (not (looking-at " "))
(re-search-backward "[^0-9]"))
(list month
- (string-to-int (buffer-substring (1+ (point)) (+ 4 (point))))
+ (string-to-number (buffer-substring (1+ (point)) (+ 4 (point))))
year))
(if (looking-at "\\*")
(save-excursion
instead of the full names in the diary file. Do not include a
trailing `.' in the strings specified in this variable, though
you may use such in the diary file. If any element of this array
-is nil, then the abbreviation will be constructed as the first
+is nil, then the abbreviation will be constructed as the first
`calendar-abbrev-length' characters of the corresponding full name.")
(defvar calendar-month-name-array
(redraw-calendar))
(defun calendar-date-is-visible-p (date)
- "Return t if DATE is legal and is visible in the calendar window."
+ "Return t if DATE is valid and is visible in the calendar window."
(let ((gap (calendar-interval
displayed-month displayed-year
(extract-calendar-month date) (extract-calendar-year date))))
(and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap))))
(defun calendar-date-is-legal-p (date)
- "Return t if DATE is a legal date."
+ "Return t if DATE is a valid date."
(let ((month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date)))
(and (<= 1 month) (<= month 12)
(<= 1 day) (<= day (calendar-last-day-of-month month year))
- ;; BC dates left as non-legal, to suppress errors from
+ ;; BC dates left as non-valid, to suppress errors from
;; complex holiday algorithms not suitable for years BC.
;; Note there are side effects on calendar navigation.
(<= 1 year))))
(forward-char -2))
(let ; attr list
((temp-face
- (make-symbol (apply 'concat "temp-face-"
+ (make-symbol (apply 'concat "temp-"
(mapcar '(lambda (sym)
(cond ((symbolp sym) (symbol-name sym))
((numberp sym) (int-to-string sym))
(make-local-variable 'calendar-starred-day)
(forward-char 1)
(setq calendar-starred-day
- (string-to-int
+ (string-to-number
(buffer-substring (point) (- (point) 2))))
(delete-char -2)
(insert "**")