changeset 57920:56342493afe3

(Buffer-menu-make-sort-button): Preserve point even when clicking from another window.
author Daniel Pfeiffer <occitan@esperanto.org>
date Wed, 03 Nov 2004 21:55:28 +0000
parents 27131f3ed0ab
children a17e7dae99c0
files lisp/buff-menu.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/buff-menu.el	Wed Nov 03 21:53:26 2004 +0000
+++ b/lisp/buff-menu.el	Wed Nov 03 21:55:28 2004 +0000
@@ -627,8 +627,9 @@
 			(define-key map [header-line mouse-2]
 			  `(lambda (e)
 			     (interactive "e")
-			     (if e (set-buffer (window-buffer (posn-window (event-end e)))))
-			     (Buffer-menu-sort ,column)))
+			     (save-window-excursion
+			       (if e (mouse-select-window e))
+			       (Buffer-menu-sort ,column))))
 			map)))
 
 (defun list-buffers-noselect (&optional files-only)