changeset 7006:5f1e5be68fcd

(Electric-buffer-menu-mouse-select): New function. (electric-buffer-menu-mode-map): Bind it to mouse-2.
author Karl Heuer <kwzh@gnu.org>
date Thu, 21 Apr 1994 14:39:40 +0000
parents 3632da43b414
children 52b0ebfd3191
files lisp/ebuff-menu.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ebuff-menu.el	Thu Apr 21 13:51:26 1994 +0000
+++ b/lisp/ebuff-menu.el	Thu Apr 21 14:39:40 1994 +0000
@@ -194,6 +194,7 @@
     (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 @@
   (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."