diff options
| author | Gerd Moellmann | 2000-02-20 15:59:04 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-02-20 15:59:04 +0000 |
| commit | ec9db7a797088154d2eb96d33d3a03e2b7363515 (patch) | |
| tree | 34268f1d4d81e5b45e8b611a045010087a980591 | |
| parent | 620cc5fa301677570852647c50f638b27ddc3c03 (diff) | |
| download | emacs-ec9db7a797088154d2eb96d33d3a03e2b7363515.tar.gz emacs-ec9db7a797088154d2eb96d33d3a03e2b7363515.zip | |
(propertized-buffer-identification): New function.
| -rw-r--r-- | lisp/bindings.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el index c24911f3d3e..976996c6f7c 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." | |||
| 282 | (define-key map [header-line mouse-2] 'bury-buffer) | 282 | (define-key map [header-line mouse-2] 'bury-buffer) |
| 283 | (define-key map [mode-line down-mouse-3] 'mouse-buffer-menu) | 283 | (define-key map [mode-line down-mouse-3] 'mouse-buffer-menu) |
| 284 | (define-key map [header-line down-mouse-3] 'mouse-buffer-menu) | 284 | (define-key map [header-line down-mouse-3] 'mouse-buffer-menu) |
| 285 | (setq mode-line-buffer-identification-keymap map) | 285 | (setq mode-line-buffer-identification-keymap map)) |
| 286 | (setq-default mode-line-buffer-identification | 286 | |
| 287 | (list (propertize "%12b" | 287 | (defun propertized-buffer-identification (fmt) |
| 288 | 'face '(:weight bold) | 288 | "Return a list suitable for `mode-line-buffer-identification'. |
| 289 | 'help-echo (purecopy "mouse-1: other \ | 289 | FMT is a format specifier such as \"%12b\". This function adds |
| 290 | text properties for face, help-echo, and local-map to it." | ||
| 291 | (list (propertize fmt | ||
| 292 | 'face '(:weight bold) | ||
| 293 | 'help-echo (purecopy "mouse-1: other \ | ||
| 290 | buffer, mouse-2: prev, M-mouse-2: next, mouse-3: buffer menu") | 294 | buffer, mouse-2: prev, M-mouse-2: next, mouse-3: buffer menu") |
| 291 | 'local-map map)))) | 295 | 'local-map mode-line-buffer-identification-keymap))) |
| 296 | |||
| 297 | (setq-default mode-line-buffer-identification | ||
| 298 | (propertized-buffer-identification "%12b")) | ||
| 292 | 299 | ||
| 293 | ;; Menu of minor modes. | 300 | ;; Menu of minor modes. |
| 294 | (let ((map (make-sparse-keymap))) | 301 | (let ((map (make-sparse-keymap))) |