# HG changeset patch # User Nick Roberts # Date 1154512148 0 # Node ID 58cba531e51d4b451e053695dc327e5971779d87 # Parent e54813ed9e8b5593cfabd81deb5719b727f0c3d3 (map): Make mode-line-buffer-identification-keymap before defining propertized-buffer-identification. diff -r e54813ed9e8b -r 58cba531e51d lisp/bindings.el --- a/lisp/bindings.el Wed Aug 02 09:48:46 2006 +0000 +++ b/lisp/bindings.el Wed Aug 02 09:49:08 2006 +0000 @@ -330,6 +330,21 @@ (defvar mode-line-buffer-identification-keymap nil "\ Keymap for what is displayed by `mode-line-buffer-identification'.") +;; Add menu of buffer operations to the buffer identification part +;; of the mode line.or header 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-previous-buffer) + (define-key map [header-line down-mouse-1] 'ignore) + (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-next-buffer) + (define-key map [header-line down-mouse-3] 'ignore) + (define-key map [header-line mouse-3] 'mode-line-next-buffer) + (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 @@ -454,21 +469,6 @@ (let ((indicator (car (nth 4 (car (cdr event)))))) (describe-minor-mode-from-indicator indicator))) -;; Add menu of buffer operations to the buffer identification part -;; of the mode line.or header 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-previous-buffer) - (define-key map [header-line down-mouse-1] 'ignore) - (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-next-buffer) - (define-key map [header-line down-mouse-3] 'ignore) - (define-key map [header-line mouse-3] 'mode-line-next-buffer) - (setq mode-line-buffer-identification-keymap map)) - (defvar minor-mode-alist nil "\ Alist saying how to show minor modes in the mode line. Each element looks like (VARIABLE STRING);