diff options
| author | Richard M. Stallman | 2002-09-09 19:37:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-09-09 19:37:19 +0000 |
| commit | 989a6aa7dd5628fea2e9bd28af960311ce67421f (patch) | |
| tree | 53f3a4fe7584189491e7a3754e7132d201714ace | |
| parent | 4eb4926c585b0074fb25f014c6d78239ee5b0421 (diff) | |
| download | emacs-989a6aa7dd5628fea2e9bd28af960311ce67421f.tar.gz emacs-989a6aa7dd5628fea2e9bd28af960311ce67421f.zip | |
(mouse-scroll-calendar-left)
(mouse-scroll-calendar-right, mouse-calendar-other-month): New commands.
(calendar-mode-line-format): Use them.
| -rw-r--r-- | lisp/calendar/calendar.el | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 8dfdfcddf12..2b0f6fe1e3b 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -2044,7 +2044,7 @@ the inserted text. Value is always t." | |||
| 2044 | "\\<calendar-mode-map>\\[scroll-calendar-left]") | 2044 | "\\<calendar-mode-map>\\[scroll-calendar-left]") |
| 2045 | 'help-echo "mouse-2: scroll left" | 2045 | 'help-echo "mouse-2: scroll left" |
| 2046 | 'keymap (make-mode-line-mouse-map 'mouse-2 | 2046 | 'keymap (make-mode-line-mouse-map 'mouse-2 |
| 2047 | #'scroll-calendar-left)) | 2047 | 'mouse-scroll-calendar-left)) |
| 2048 | "Calendar" | 2048 | "Calendar" |
| 2049 | (concat | 2049 | (concat |
| 2050 | (propertize | 2050 | (propertize |
| @@ -2058,11 +2058,7 @@ the inserted text. Value is always t." | |||
| 2058 | "\\<calendar-mode-map>\\[calendar-other-month] other") | 2058 | "\\<calendar-mode-map>\\[calendar-other-month] other") |
| 2059 | 'help-echo "mouse-2: choose another month" | 2059 | 'help-echo "mouse-2: choose another month" |
| 2060 | 'keymap (make-mode-line-mouse-map | 2060 | 'keymap (make-mode-line-mouse-map |
| 2061 | 'mouse-2 | 2061 | 'mouse-2 'mouse-calendar-other-month)) |
| 2062 | (lambda () | ||
| 2063 | (interactive) | ||
| 2064 | (call-interactively | ||
| 2065 | 'calendar-other-month)))) | ||
| 2066 | "/" | 2062 | "/" |
| 2067 | (propertize | 2063 | (propertize |
| 2068 | (substitute-command-keys | 2064 | (substitute-command-keys |
| @@ -2074,7 +2070,7 @@ the inserted text. Value is always t." | |||
| 2074 | "\\<calendar-mode-map>\\[scroll-calendar-right]") | 2070 | "\\<calendar-mode-map>\\[scroll-calendar-right]") |
| 2075 | 'help-echo "mouse-2: scroll right" | 2071 | 'help-echo "mouse-2: scroll right" |
| 2076 | 'keymap (make-mode-line-mouse-map | 2072 | 'keymap (make-mode-line-mouse-map |
| 2077 | 'mouse-2 #'scroll-calendar-right))) | 2073 | 'mouse-2 'mouse-scroll-calendar-right))) |
| 2078 | "The mode line of the calendar buffer. | 2074 | "The mode line of the calendar buffer. |
| 2079 | 2075 | ||
| 2080 | This must be a list of items that evaluate to strings--those strings are | 2076 | This must be a list of items that evaluate to strings--those strings are |
| @@ -2102,6 +2098,31 @@ under the cursor: | |||
| 2102 | \"\")) | 2098 | \"\")) |
| 2103 | ") | 2099 | ") |
| 2104 | 2100 | ||
| 2101 | (defun mouse-scroll-calendar-left (event) | ||
| 2102 | "Scroll the displayed calendar left by one month. | ||
| 2103 | Maintains the relative position of the cursor | ||
| 2104 | with respect to the calendar as well as possible." | ||
| 2105 | (interactive "e") | ||
| 2106 | (save-selected-window | ||
| 2107 | (select-window (posn-window (event-start event))) | ||
| 2108 | (scroll-calendar-left 1))) | ||
| 2109 | |||
| 2110 | (defun mouse-scroll-calendar-right (event) | ||
| 2111 | "Scroll the displayed calendar right by one month. | ||
| 2112 | Maintains the relative position of the cursor | ||
| 2113 | with respect to the calendar as well as possible." | ||
| 2114 | (interactive "e") | ||
| 2115 | (save-selected-window | ||
| 2116 | (select-window (posn-window (event-start event))) | ||
| 2117 | (scroll-calendar-right 1))) | ||
| 2118 | |||
| 2119 | (defun mouse-calendar-other-month (event) | ||
| 2120 | "Display a three-month calendar centered around a specified month and year." | ||
| 2121 | (interactive "e") | ||
| 2122 | (save-selected-window | ||
| 2123 | (select-window (posn-window (event-start event))) | ||
| 2124 | (call-interactively 'calendar-other-month))) | ||
| 2125 | |||
| 2105 | (defun calendar-goto-info-node () | 2126 | (defun calendar-goto-info-node () |
| 2106 | "Go to the info node for the calendar." | 2127 | "Go to the info node for the calendar." |
| 2107 | (interactive) | 2128 | (interactive) |