]> git.eshelyaron.com Git - emacs.git/commitdiff
(calendar-mode-map): Make mouse-1 and 3 clicks on the scroll-bar
authorGlenn Morris <rgm@gnu.org>
Tue, 22 Sep 2009 07:37:58 +0000 (07:37 +0000)
committerGlenn Morris <rgm@gnu.org>
Tue, 22 Sep 2009 07:37:58 +0000 (07:37 +0000)
scroll the calendar window rather than the buffer.

lisp/ChangeLog
lisp/calendar/calendar.el

index a4548a9dae5d38b0fe321575f1bfb708cd935940..880dd09a6c9dc5e87f743f0063da1de3227321fc 100644 (file)
@@ -1,5 +1,8 @@
 2009-09-22  Glenn Morris  <rgm@gnu.org>
 
+       * calendar/calendar.el (calendar-mode-map): Make mouse-1 and 3 clicks on
+       the scroll-bar scroll the calendar window rather than the buffer.
+
        * calendar/cal-menu.el (cal-menu-scroll-menu): Add a sub-section with
        commands that move point (as opposed to scrolling).
 
index 2140e5384929ece146be675f91226ca4b6165508..2617c8004b72348123cb876b46c322a0d8d0e2e1 100644 (file)
@@ -1594,6 +1594,14 @@ line."
     (define-key map [down-mouse-2]
       (easy-menu-binding cal-menu-global-mouse-menu))
 
+    ;; Left-click moves us forward in time, right-click backwards.
+    ;; cf scroll-bar.el.
+    (define-key map [vertical-scroll-bar mouse-1] 'calendar-scroll-left)
+    (define-key map [vertical-scroll-bar drag-mouse-1] 'calendar-scroll-left)
+    ;; down-mouse-2 stays as scroll-bar-drag.
+    (define-key map [vertical-scroll-bar mouse-3] 'calendar-scroll-right)
+    (define-key map [vertical-scroll-bar drag-mouse-3] 'calendar-scroll-right)
+
     map)
   "Keymap for `calendar-mode'.")