aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-07-29 02:07:22 +0000
committerRichard M. Stallman2006-07-29 02:07:22 +0000
commit3bd80f8b6b82dfabeacd93070a718bf99f83a244 (patch)
treec52455585c4554d92a0d7e641ef768048e04007d
parent13eb1bded17be81b2041fb9979f9d7a13b914742 (diff)
downloademacs-3bd80f8b6b82dfabeacd93070a718bf99f83a244.tar.gz
emacs-3bd80f8b6b82dfabeacd93070a718bf99f83a244.zip
(mode-line-frame-identification)
(propertized-buffer-identification): Centralize the code to initialize the variable.
-rw-r--r--lisp/bindings.el41
1 files changed, 19 insertions, 22 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 5420badde90..8a96387f2a1 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -209,14 +209,6 @@ mnemonics of the following coding systems:
209 209
210(make-variable-buffer-local 'mode-line-mule-info) 210(make-variable-buffer-local 'mode-line-mule-info)
211 211
212(defvar mode-line-buffer-identification (purecopy '("%12b")) "\
213Mode-line control for identifying the buffer being displayed.
214Its default value is (\"%12b\").
215Major modes that edit things other than ordinary files may change this
216\(e.g. Info, Dired,...)")
217
218(make-variable-buffer-local 'mode-line-buffer-identification)
219
220(defvar mode-line-frame-identification '("-%F ") 212(defvar mode-line-frame-identification '("-%F ")
221 "Mode-line control to describe the current frame.") 213 "Mode-line control to describe the current frame.")
222 214
@@ -337,6 +329,25 @@ Keymap to display on minor modes.")
337(defvar mode-line-buffer-identification-keymap nil "\ 329(defvar mode-line-buffer-identification-keymap nil "\
338Keymap for what is displayed by `mode-line-buffer-identification'.") 330Keymap for what is displayed by `mode-line-buffer-identification'.")
339 331
332(defun propertized-buffer-identification (fmt)
333 "Return a list suitable for `mode-line-buffer-identification'.
334FMT is a format specifier such as \"%12b\". This function adds
335text properties for face, help-echo, and local-map to it."
336 (list (propertize fmt
337 'face 'mode-line-buffer-id
338 'help-echo
339 (purecopy "mouse-1: previous buffer, mouse-3: next buffer")
340 'mouse-face 'mode-line-highlight
341 'local-map mode-line-buffer-identification-keymap)))
342
343(defvar mode-line-buffer-identification (propertized-buffer-identification "%12b") "\
344Mode-line control for identifying the buffer being displayed.
345Its default value is (\"%12b\") with some text properties added.
346Major modes that edit things other than ordinary files may change this
347\(e.g. Info, Dired,...)")
348
349(make-variable-buffer-local 'mode-line-buffer-identification)
350
340(defun unbury-buffer () "\ 351(defun unbury-buffer () "\
341Switch to the last buffer in the buffer list." 352Switch to the last buffer in the buffer list."
342 (interactive) 353 (interactive)
@@ -457,20 +468,6 @@ Menu of mode operations in the mode line.")
457 (define-key map [header-line mouse-3] 'mode-line-next-buffer) 468 (define-key map [header-line mouse-3] 'mode-line-next-buffer)
458 (setq mode-line-buffer-identification-keymap map)) 469 (setq mode-line-buffer-identification-keymap map))
459 470
460(defun propertized-buffer-identification (fmt)
461 "Return a list suitable for `mode-line-buffer-identification'.
462FMT is a format specifier such as \"%12b\". This function adds
463text properties for face, help-echo, and local-map to it."
464 (list (propertize fmt
465 'face 'mode-line-buffer-id
466 'help-echo
467 (purecopy "mouse-1: previous buffer, mouse-3: next buffer")
468 'mouse-face 'mode-line-highlight
469 'local-map mode-line-buffer-identification-keymap)))
470
471(setq-default mode-line-buffer-identification
472 (propertized-buffer-identification "%12b"))
473
474(defvar minor-mode-alist nil "\ 471(defvar minor-mode-alist nil "\
475Alist saying how to show minor modes in the mode line. 472Alist saying how to show minor modes in the mode line.
476Each element looks like (VARIABLE STRING); 473Each element looks like (VARIABLE STRING);