]> git.eshelyaron.com Git - emacs.git/commitdiff
(Info-mouse-scroll-up, Info-mouse-scroll-down): New functions.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 23 Apr 2007 15:21:47 +0000 (15:21 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 23 Apr 2007 15:21:47 +0000 (15:21 +0000)
(Info-mode-line-node-keymap): Bind mouse commands to
Info-mouse-scroll-up/down instead of Info-scroll-up/down.

lisp/info.el

index 6f9b1863ee4ab80b606bb5409591518d709d4af8..4bf83c265b0116dca7a2b1e3f970b1f2156b2b9a 100644 (file)
@@ -1400,8 +1400,8 @@ any double quotes or backslashes must be escaped (\\\",\\\\)."
 
 (defvar Info-mode-line-node-keymap
   (let ((map (make-sparse-keymap)))
-    (define-key map [mode-line mouse-1] 'Info-scroll-up)
-    (define-key map [mode-line mouse-3] 'Info-scroll-down)
+    (define-key map [mode-line mouse-1] 'Info-mouse-scroll-up)
+    (define-key map [mode-line mouse-3] 'Info-mouse-scroll-down)
     map)
   "Keymap to put on the Info node name in the mode line.")
 
@@ -2620,6 +2620,15 @@ in other ways.)"
         (t (Info-next-preorder)))
       (scroll-up))))
 
+(defun Info-mouse-scroll-up (e)
+  "Scroll one screenful forward in Info, using the mouse.
+See `Info-scroll-up'."
+  (interactive "e")
+  (save-selected-window
+    (if (eventp e)
+       (select-window (posn-window (event-start e))))
+    (Info-scroll-up)))
+
 (defun Info-scroll-down ()
   "Scroll one screenful back in Info, considering all nodes as one sequence.
 If point is within the menu of a node, and `Info-scroll-prefer-subnodes'
@@ -2646,6 +2655,15 @@ parent node."
        (Info-last-preorder)
       (scroll-down))))
 
+(defun Info-mouse-scroll-down (e)
+  "Scroll one screenful backward in Info, using the mouse.
+See `Info-scroll-down'."
+  (interactive "e")
+  (save-selected-window
+    (if (eventp e)
+       (select-window (posn-window (event-start e))))
+    (Info-scroll-down)))
+
 (defun Info-next-reference (&optional recur)
   "Move cursor to the next cross-reference or menu item in the node."
   (interactive)