summaryrefslogtreecommitdiff
path: root/lisp/ebuff-menu.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-04-21 14:39:40 +0000
committerKarl Heuer <kwzh@gnu.org>1994-04-21 14:39:40 +0000
commitbeb25587adfc51d08d550295c0ad0fcf980e72b8 (patch)
treeae9d23b4c0985a4eee583e738a5c8102e07475fa /lisp/ebuff-menu.el
parent536009850a3aad192fb3b3886f22e52bdf55b143 (diff)
downloademacs-beb25587adfc51d08d550295c0ad0fcf980e72b8.tar.gz
(Electric-buffer-menu-mouse-select): New function.
(electric-buffer-menu-mode-map): Bind it to mouse-2.
Diffstat (limited to 'lisp/ebuff-menu.el')
-rw-r--r--lisp/ebuff-menu.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index 7e511cc4d5f..f39b9d7e6aa 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -194,6 +194,7 @@ electric-buffer-menu-mode-hook if it is non-nil."
(define-key map "\e\C-v" 'scroll-other-window)
(define-key map "\e>" 'end-of-buffer)
(define-key map "\e<" 'beginning-of-buffer)
+ (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
(setq electric-buffer-menu-mode-map map)))
(defun Electric-buffer-menu-exit ()
@@ -212,6 +213,13 @@ Selects buffer at point and displays buffers marked \">\" in other windows."
(interactive)
(throw 'electric-buffer-menu-select (point)))
+(defun Electric-buffer-menu-mouse-select (event)
+ (interactive "e")
+ (select-window (posn-window (event-end event)))
+ (set-buffer (window-buffer (selected-window)))
+ (goto-char (posn-point (event-end event)))
+ (throw 'electric-buffer-menu-select (point)))
+
(defun Electric-buffer-menu-quit ()
"Leave Electric Buffer Menu, restoring previous window configuration.
Does not execute select, save, or delete commands."