aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calendar/calendar.el110
1 files changed, 55 insertions, 55 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index f081d1cd437..35dc6119015 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -494,6 +494,58 @@ Must be at least one less than `calendar-column-width'."
494 :type 'integer 494 :type 'integer
495 :version "23.1") 495 :version "23.1")
496 496
497(defcustom calendar-intermonth-header nil
498 "Header text display in the space to the left of each calendar month.
499See `calendar-intermonth-text'."
500 :group 'calendar
501 :initialize 'custom-initialize-default
502 :risky t
503 :set (lambda (sym val)
504 (set sym val)
505 (calendar-redraw))
506 :type '(choice (const nil :tag "Nothing")
507 (string :tag "Fixed string")
508 (sexp :value
509 (propertize "WK" 'font-lock-face
510 'font-lock-function-name-face)))
511 :version "23.1")
512
513(defcustom calendar-intermonth-text nil
514 "Text to display in the space to the left of each calendar month.
515Can be nil, a fixed string, or a lisp expression that returns a string.
516When the expression is evaluated, the variables DAY, MONTH and YEAR
517are integers appropriate for the first day in each week.
518Will be truncated to the smaller of `calendar-left-margin' and
519`calendar-intermonth-spacing'. The last character is forced to be a space.
520For example, to display the ISO week numbers:
521
522 (setq calendar-week-start-day 1
523 calendar-intermonth-text
524 '(propertize
525 (format \"%2d\"
526 (car
527 (calendar-iso-from-absolute
528 (calendar-absolute-from-gregorian (list month day year)))))
529 'font-lock-face 'font-lock-function-name-face))
530
531See also `calendar-intermonth-header'."
532 :group 'calendar
533 :initialize 'custom-initialize-default
534 :risky t
535 :set (lambda (sym val)
536 (set sym val)
537 (calendar-redraw))
538 :type '(choice (const nil :tag "Nothing")
539 (string :tag "Fixed string")
540 (sexp :value
541 (propertize
542 (format "%2d"
543 (car
544 (calendar-iso-from-absolute
545 (calendar-absolute-from-gregorian
546 (list month day year)))))
547 'font-lock-face 'font-lock-function-name-face)))
548 :version "23.1")
497 549
498(defcustom diary-file "~/diary" 550(defcustom diary-file "~/diary"
499 "Name of the file in which one's personal diary of dates is kept. 551 "Name of the file in which one's personal diary of dates is kept.
@@ -1303,59 +1355,6 @@ Optional integers MON and YR are used instead of today's date."
1303 (or (zerop (forward-line 1)) 1355 (or (zerop (forward-line 1))
1304 (insert "\n"))) 1356 (insert "\n")))
1305 1357
1306(defcustom calendar-intermonth-header nil
1307 "Header text display in the space to the left of each calendar month.
1308See `calendar-intermonth-text'."
1309 :group 'calendar
1310 :initialize 'custom-initialize-default
1311 :risky t
1312 :set (lambda (sym val)
1313 (set sym val)
1314 (calendar-redraw))
1315 :type '(choice (const nil :tag "Nothing")
1316 (string :tag "Fixed string")
1317 (sexp :value
1318 (propertize "WK" 'font-lock-face
1319 'font-lock-function-name-face)))
1320 :version "23.1")
1321
1322(defcustom calendar-intermonth-text nil
1323 "Text to display in the space to the left of each calendar month.
1324Can be nil, a fixed string, or a lisp expression that returns a string.
1325When the expression is evaluated, the variables DAY, MONTH and YEAR
1326are integers appropriate for the first day in each week.
1327Will be truncated to the smaller of `calendar-left-margin' and
1328`calendar-intermonth-spacing'. The last character is forced to be a space.
1329For example, to display the ISO week numbers:
1330
1331 (setq calendar-week-start-day 1
1332 calendar-intermonth-text
1333 '(propertize
1334 (format \"%2d\"
1335 (car
1336 (calendar-iso-from-absolute
1337 (calendar-absolute-from-gregorian (list month day year)))))
1338 'font-lock-face 'font-lock-function-name-face))
1339
1340See also `calendar-intermonth-header'."
1341 :group 'calendar
1342 :initialize 'custom-initialize-default
1343 :risky t
1344 :set (lambda (sym val)
1345 (set sym val)
1346 (calendar-redraw))
1347 :type '(choice (const nil :tag "Nothing")
1348 (string :tag "Fixed string")
1349 (sexp :value
1350 (propertize
1351 (format "%2d"
1352 (car
1353 (calendar-iso-from-absolute
1354 (calendar-absolute-from-gregorian
1355 (list month day year)))))
1356 'font-lock-face 'font-lock-function-name-face)))
1357 :version "23.1")
1358
1359(defun calendar-insert-at-column (indent string truncate) 1358(defun calendar-insert-at-column (indent string truncate)
1360 "Move to column INDENT, adding spaces as needed. 1359 "Move to column INDENT, adding spaces as needed.
1361Inserts STRING so that it ends at INDENT. STRING is either a 1360Inserts STRING so that it ends at INDENT. STRING is either a
@@ -2425,14 +2424,15 @@ If called by a mouse-event, pops up a menu with the result."
2425 (interactive (list last-nonmenu-event)) 2424 (interactive (list last-nonmenu-event))
2426 (let* ((date (calendar-cursor-to-date t event)) 2425 (let* ((date (calendar-cursor-to-date t event))
2427 (title (format "%s (Gregorian)" (calendar-date-string date))) 2426 (title (format "%s (Gregorian)" (calendar-date-string date)))
2427 (others (calendar-other-dates date))
2428 selection) 2428 selection)
2429 (if (mouse-event-p event) 2429 (if (mouse-event-p event)
2430 (and (setq selection (cal-menu-x-popup-menu event title 2430 (and (setq selection (cal-menu-x-popup-menu event title
2431 (mapcar 'list (calendar-other-dates date)))) 2431 (mapcar 'list others)))
2432 (call-interactively selection)) 2432 (call-interactively selection))
2433 (calendar-in-read-only-buffer calendar-other-calendars-buffer 2433 (calendar-in-read-only-buffer calendar-other-calendars-buffer
2434 (calendar-set-mode-line title) 2434 (calendar-set-mode-line title)
2435 (insert (mapconcat 'identity (calendar-other-dates date) "\n")))))) 2435 (insert (mapconcat 'identity others "\n"))))))
2436 2436
2437(defun calendar-print-day-of-year () 2437(defun calendar-print-day-of-year ()
2438 "Show day number in year/days remaining in year for date under the cursor." 2438 "Show day number in year/days remaining in year for date under the cursor."