summaryrefslogtreecommitdiff
path: root/lisp/bindings.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2006-01-16 23:50:39 +0000
committerJuri Linkov <juri@jurta.org>2006-01-16 23:50:39 +0000
commit5581c52a3ee657c06100711db336279b6b9f3831 (patch)
tree85479a961c170eafbcf737c9f087b805a049bfae /lisp/bindings.el
parent468bcaeb4b13f051130571e821985b7db41832f8 (diff)
downloademacs-5581c52a3ee657c06100711db336279b6b9f3831.tar.gz
(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.
Diffstat (limited to 'lisp/bindings.el')
-rw-r--r--lisp/bindings.el24
1 files changed, 19 insertions, 5 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 7e9467b19c5..7b122dad5f8 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -362,6 +362,20 @@ Switch to the most recently selected buffer other than the current one."
(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 @@ Menu of mode operations in the mode line.")
(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 @@ Menu of mode operations in the mode line.")
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