comparison lisp/calendar/calendar.el @ 54536:934d92d8b496

(calendar-set-mode-line): Use total available mode-line width, rather than frame-width.
author Glenn Morris <rgm@gnu.org>
date Wed, 24 Mar 2004 18:37:08 +0000
parents 520476f3222d
children b278cb498cc8
comparison
equal deleted inserted replaced
54535:f5c18c1f02ce 54536:934d92d8b496
1913 (sit-for 0) 1913 (sit-for 0)
1914 (if (and (boundp 'font-lock-mode) 1914 (if (and (boundp 'font-lock-mode)
1915 font-lock-mode) 1915 font-lock-mode)
1916 (font-lock-fontify-buffer)) 1916 (font-lock-fontify-buffer))
1917 (and mark-holidays-in-calendar 1917 (and mark-holidays-in-calendar
1918 ;;; (calendar-date-is-legal-p today) ; useful for BC dates
1918 (mark-calendar-holidays) 1919 (mark-calendar-holidays)
1919 (sit-for 0)) 1920 (sit-for 0))
1920 (unwind-protect 1921 (unwind-protect
1921 (if mark-diary-entries-in-calendar (mark-diary-entries)) 1922 (if mark-diary-entries-in-calendar (mark-diary-entries))
1922 (if today-visible 1923 (if today-visible
2931 (message (calendar-day-of-year-string (calendar-cursor-to-date t)))) 2932 (message (calendar-day-of-year-string (calendar-cursor-to-date t))))
2932 2933
2933 (defun calendar-set-mode-line (str) 2934 (defun calendar-set-mode-line (str)
2934 "Set mode line to STR, centered, surrounded by dashes." 2935 "Set mode line to STR, centered, surrounded by dashes."
2935 (setq mode-line-format 2936 (setq mode-line-format
2936 (calendar-string-spread (list str) ?- (frame-width)))) 2937 (calendar-string-spread
2938 (list str) ?-
2939 ;; As per doc of window-width, total visible mode-line length.
2940 (let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))))))
2937 2941
2938 (defun calendar-mod (m n) 2942 (defun calendar-mod (m n)
2939 "Non-negative remainder of M/N with N instead of 0." 2943 "Non-negative remainder of M/N with N instead of 0."
2940 (1+ (mod (1- m) n))) 2944 (1+ (mod (1- m) n)))
2941 2945