aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>2000-02-20 15:59:04 +0000
committerGerd Moellmann <[email protected]>2000-02-20 15:59:04 +0000
commitec9db7a797088154d2eb96d33d3a03e2b7363515 (patch)
tree34268f1d4d81e5b45e8b611a045010087a980591
parent620cc5fa301677570852647c50f638b27ddc3c03 (diff)
(propertized-buffer-identification): New function.
-rw-r--r--lisp/bindings.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el
index c24911f3d3..976996c6f7 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -282,13 +282,20 @@ Return a string to display in the mode line for the current mode name."
(define-key map [header-line mouse-2] 'bury-buffer)
(define-key map [mode-line down-mouse-3] 'mouse-buffer-menu)
(define-key map [header-line down-mouse-3] 'mouse-buffer-menu)
- (setq mode-line-buffer-identification-keymap map)
- (setq-default mode-line-buffer-identification
- (list (propertize "%12b"
- 'face '(:weight bold)
- 'help-echo (purecopy "mouse-1: other \
+ (setq mode-line-buffer-identification-keymap map))
+
+(defun propertized-buffer-identification (fmt)
+ "Return a list suitable for `mode-line-buffer-identification'.
+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 '(:weight bold)
+ 'help-echo (purecopy "mouse-1: other \
buffer, mouse-2: prev, M-mouse-2: next, mouse-3: buffer menu")
- 'local-map map))))
+ 'local-map mode-line-buffer-identification-keymap)))
+
+(setq-default mode-line-buffer-identification
+ (propertized-buffer-identification "%12b"))
;; Menu of minor modes.
(let ((map (make-sparse-keymap)))