changeset 68215:d300de715fe6

(propertized-buffer-identification): Use face `mode-line-buffer-id' instead of `Buffer-menu-buffer'. (mode-line-next-buffer, mode-line-previous-buffer): New functions. (mode-line-buffer-identification-keymap): For mouse-1 replace `mode-line-unbury-buffer' with `mode-line-previous-buffer'. Replace `mode-line-bury-buffer' with `mode-line-next-buffer' for mouse-3.
author Juri Linkov <juri@jurta.org>
date Mon, 16 Jan 2006 23:50:39 +0000
parents 7943b5aaa49d
children 9f1c66838760
files lisp/bindings.el
diffstat 1 files changed, 19 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/bindings.el	Mon Jan 16 23:45:34 2006 +0000
+++ b/lisp/bindings.el	Mon Jan 16 23:50:39 2006 +0000
@@ -362,6 +362,20 @@
   (interactive)
   (switch-to-buffer (other-buffer)))
 
+(defun mode-line-next-buffer (event)
+  "Like `next-buffer', but temporarily select EVENT's window."
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (next-buffer)))
+
+(defun mode-line-previous-buffer (event)
+  "Like `previous-buffer', but temporarily select EVENT's window."
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (previous-buffer)))
+
 (defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\
 Menu of mode operations in the mode line.")
 
@@ -435,13 +449,13 @@
 (let ((map (make-sparse-keymap)))
   ;; Bind down- events so that the global keymap won't ``shine
   ;; through''.
-  (define-key map [mode-line mouse-1] 'mode-line-unbury-buffer)
+  (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
   (define-key map [header-line down-mouse-1] 'ignore)
-  (define-key map [header-line mouse-1] 'mode-line-unbury-buffer)
+  (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
   (define-key map [header-line down-mouse-3] 'ignore)
-  (define-key map [mode-line mouse-3] 'mode-line-bury-buffer)
+  (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
   (define-key map [header-line down-mouse-3] 'ignore)
-  (define-key map [header-line mouse-3] 'mode-line-bury-buffer)
+  (define-key map [header-line mouse-3] 'mode-line-next-buffer)
   (setq mode-line-buffer-identification-keymap map))
 
 (defun propertized-buffer-identification (fmt)
@@ -449,7 +463,7 @@
 FMT is a format specifier such as \"%12b\".  This function adds
 text properties for face, help-echo, and local-map to it."
   (list (propertize fmt
-		    'face 'Buffer-menu-buffer
+		    'face 'mode-line-buffer-id
 		    'help-echo
 		    (purecopy "mouse-1: previous buffer, mouse-3: next buffer")
 		    'mouse-face 'mode-line-highlight