diff options
| author | Glenn Morris | 2008-03-08 21:05:13 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-08 21:05:13 +0000 |
| commit | 5bbcf603323c8118854fe2ea6dccf5f86b09ce91 (patch) | |
| tree | 7b38298fb75ce365e9a21d8123e84756cff79913 | |
| parent | c723ec5e264129910c0fcaca9c7f94499aaa69d2 (diff) | |
| download | emacs-5bbcf603323c8118854fe2ea6dccf5f86b09ce91.tar.gz emacs-5bbcf603323c8118854fe2ea6dccf5f86b09ce91.zip | |
(cal-menu-holiday-window-suffix)
(cal-menu-x-popup-menu, calendar-mouse-holidays)
(calendar-mouse-view-diary-entries, calendar-mouse-print-dates)
(calendar-mouse-goto-date): Doc fixes.
(cal-menu-set-date-title): Move definition before use.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/calendar/cal-menu.el | 27 |
2 files changed, 20 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fd96e1ae578..ddc59b237bd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -50,6 +50,10 @@ | |||
| 50 | (calendar-read-mayan-haab-date, calendar-read-mayan-tzolkin-date) | 50 | (calendar-read-mayan-haab-date, calendar-read-mayan-tzolkin-date) |
| 51 | (calendar-next-calendar-round-date) | 51 | (calendar-next-calendar-round-date) |
| 52 | (calendar-mayan-long-count-common-era): | 52 | (calendar-mayan-long-count-common-era): |
| 53 | * calendar/cal-menu.el (cal-menu-holiday-window-suffix) | ||
| 54 | (cal-menu-x-popup-menu, calendar-mouse-holidays) | ||
| 55 | (calendar-mouse-view-diary-entries, calendar-mouse-print-dates) | ||
| 56 | (calendar-mouse-goto-date): | ||
| 53 | * calendar/cal-move.el (calendar-scroll-left, calendar-scroll-right): | 57 | * calendar/cal-move.el (calendar-scroll-left, calendar-scroll-right): |
| 54 | * calendar/lunar.el (phases-of-moon, lunar-new-moon-on-or-after): | 58 | * calendar/lunar.el (phases-of-moon, lunar-new-moon-on-or-after): |
| 55 | Doc fixes. | 59 | Doc fixes. |
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index 2b2efd1cb3a..f458ebec2f7 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el | |||
| @@ -116,6 +116,7 @@ | |||
| 116 | ["Yearly" insert-yearly-hebrew-diary-entry]))) | 116 | ["Yearly" insert-yearly-hebrew-diary-entry]))) |
| 117 | 117 | ||
| 118 | (defun cal-menu-holiday-window-suffix () | 118 | (defun cal-menu-holiday-window-suffix () |
| 119 | "Return a string suffix for the \"Window\" entry in `cal-menu-holidays-menu'." | ||
| 119 | (let ((my1 (calendar-increment-month -1)) | 120 | (let ((my1 (calendar-increment-month -1)) |
| 120 | (my2 (calendar-increment-month 1))) | 121 | (my2 (calendar-increment-month 1))) |
| 121 | (if (= (cdr my1) (cdr my2)) | 122 | (if (= (cdr my1) (cdr my2)) |
| @@ -200,8 +201,8 @@ | |||
| 200 | ["Backward 1 Year" "4\ev"])) | 201 | ["Backward 1 Year" "4\ev"])) |
| 201 | 202 | ||
| 202 | (defun cal-menu-x-popup-menu (position menu) | 203 | (defun cal-menu-x-popup-menu (position menu) |
| 203 | "Like `x-popup-menu', but prints an error message if popup menus are | 204 | "Like `x-popup-menu', but print an error message if popups are unavailable. |
| 204 | not available." | 205 | POSITION and MENU are passed to `x-popup-menu'." |
| 205 | (if (display-popup-menus-p) | 206 | (if (display-popup-menus-p) |
| 206 | (x-popup-menu position menu) | 207 | (x-popup-menu position menu) |
| 207 | (error "Popup menus are not available on this system"))) | 208 | (error "Popup menus are not available on this system"))) |
| @@ -251,7 +252,8 @@ ERROR is t, otherwise just returns nil." | |||
| 251 | (autoload 'diary-list-entries "diary-lib") | 252 | (autoload 'diary-list-entries "diary-lib") |
| 252 | 253 | ||
| 253 | (defun calendar-mouse-holidays (&optional event) | 254 | (defun calendar-mouse-holidays (&optional event) |
| 254 | "Pop up menu of holidays for mouse selected date." | 255 | "Pop up menu of holidays for mouse selected date. |
| 256 | EVENT is the event that invoked this command." | ||
| 255 | (interactive "e") | 257 | (interactive "e") |
| 256 | (let* ((date (calendar-event-to-date)) | 258 | (let* ((date (calendar-event-to-date)) |
| 257 | (l (mapcar 'list (calendar-check-holidays date))) | 259 | (l (mapcar 'list (calendar-check-holidays date))) |
| @@ -269,9 +271,9 @@ ERROR is t, otherwise just returns nil." | |||
| 269 | 271 | ||
| 270 | (defun calendar-mouse-view-diary-entries (&optional date diary event) | 272 | (defun calendar-mouse-view-diary-entries (&optional date diary event) |
| 271 | "Pop up menu of diary entries for mouse-selected date. | 273 | "Pop up menu of diary entries for mouse-selected date. |
| 272 | Use optional DATE and alternative file DIARY. | 274 | Use optional DATE and alternative file DIARY. EVENT is the event |
| 273 | 275 | that invoked this command. Shows holidays if `holidays-in-diary-buffer' | |
| 274 | Any holidays are shown if `holidays-in-diary-buffer' is t." | 276 | is non-nil." |
| 275 | (interactive "i\ni\ne") | 277 | (interactive "i\ni\ne") |
| 276 | (let* ((date (or date (calendar-event-to-date))) | 278 | (let* ((date (or date (calendar-event-to-date))) |
| 277 | (diary-file (if diary diary diary-file)) | 279 | (diary-file (if diary diary diary-file)) |
| @@ -418,7 +420,8 @@ The output is in landscape format, one month to a page." | |||
| 418 | (cal-tex-cursor-year-landscape nil))) | 420 | (cal-tex-cursor-year-landscape nil))) |
| 419 | 421 | ||
| 420 | (defun calendar-mouse-print-dates (&optional event) | 422 | (defun calendar-mouse-print-dates (&optional event) |
| 421 | "Pop up menu of equivalent dates to mouse selected date." | 423 | "Pop up menu of equivalent dates to mouse selected date. |
| 424 | EVENT is the event that invoked this command." | ||
| 422 | (interactive "e") | 425 | (interactive "e") |
| 423 | (let* ((date (calendar-event-to-date)) | 426 | (let* ((date (calendar-event-to-date)) |
| 424 | (selection | 427 | (selection |
| @@ -476,9 +479,15 @@ The output is in landscape format, one month to a page." | |||
| 476 | (calendar-print-chinese-date))) | 479 | (calendar-print-chinese-date))) |
| 477 | 480 | ||
| 478 | (defun calendar-mouse-goto-date (date) | 481 | (defun calendar-mouse-goto-date (date) |
| 482 | "Goto DATE in the buffer specified by `last-input-event'." | ||
| 479 | (set-buffer (window-buffer (posn-window (event-start last-input-event)))) | 483 | (set-buffer (window-buffer (posn-window (event-start last-input-event)))) |
| 480 | (calendar-goto-date date)) | 484 | (calendar-goto-date date)) |
| 481 | 485 | ||
| 486 | (defun cal-menu-set-date-title (menu) | ||
| 487 | "Convert date of last event to title suitable for MENU." | ||
| 488 | (easy-menu-filter-return | ||
| 489 | menu (calendar-date-string (calendar-event-to-date t) t nil))) | ||
| 490 | |||
| 482 | (easy-menu-define cal-menu-context-mouse-menu nil | 491 | (easy-menu-define cal-menu-context-mouse-menu nil |
| 483 | "Pop up menu for Mouse-2 for selected date in the calendar window." | 492 | "Pop up menu for Mouse-2 for selected date in the calendar window." |
| 484 | '("foo" :filter cal-menu-set-date-title | 493 | '("foo" :filter cal-menu-set-date-title |
| @@ -506,10 +515,6 @@ The output is in landscape format, one month to a page." | |||
| 506 | ["Insert diary entry" calendar-mouse-insert-diary-entry] | 515 | ["Insert diary entry" calendar-mouse-insert-diary-entry] |
| 507 | ["Other diary file entries" calendar-mouse-view-other-diary-entries])) | 516 | ["Other diary file entries" calendar-mouse-view-other-diary-entries])) |
| 508 | 517 | ||
| 509 | (defun cal-menu-set-date-title (menu) | ||
| 510 | (easy-menu-filter-return | ||
| 511 | menu (calendar-date-string (calendar-event-to-date t) t nil))) | ||
| 512 | |||
| 513 | (easy-menu-define cal-menu-global-mouse-menu nil | 518 | (easy-menu-define cal-menu-global-mouse-menu nil |
| 514 | "Menu bound to a mouse event, not specific to the mouse-click location." | 519 | "Menu bound to a mouse event, not specific to the mouse-click location." |
| 515 | '("Calendar" | 520 | '("Calendar" |