diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2003-03-31 20:24:56 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2003-03-31 20:24:56 +0000 |
commit | 8a42b33604147aa2e4678ac398492e17a86c7829 (patch) | |
tree | 092f30a82fc38ab8d75773f4e7f0b94f08915d64 /lisp/bindings.el | |
parent | 8e86406878ccfca4f3a2deaa7c2e76ea71532c15 (diff) | |
download | emacs-8a42b33604147aa2e4678ac398492e17a86c7829.tar.gz |
(mode-line-major-mode-keymap): New variable.
(mode-line-minor-mode-help): New function, bound to mode-line-minor-mode-keymap.
(mode-line-modes): Split mode-line-mode definitions to mode-name,
mode-line-process and minor-mode-alist. For mode-name,
mode-line-major-mode-keymap is used.
Diffstat (limited to 'lisp/bindings.el')
-rw-r--r-- | lisp/bindings.el | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el index 23f55b47565..a8546750ac4 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -28,7 +28,7 @@ ;;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ;;; Special formatting conventions are used in this file! ;;; -;;; a backslash-newline is used at the beginning of a documentation string +;;; A backslash-newline is used at the beginning of a documentation string ;;; when that string should be stored in the file etc/DOCnnn, not in core. ;;; ;;; Such strings read into Lisp as numbers (during the pure-loading phase). @@ -256,11 +256,19 @@ Normally nil in most modes, since there is no process to display.") (defvar mode-line-modes nil "Mode-line control for displaying major and minor modes.") +(defvar mode-line-major-mode-keymap nil "\ +Keymap to display on major mode.") + (defvar mode-line-minor-mode-keymap nil "\ -Keymap to display on major and minor modes.") +Keymap to display on minor modes.") + +(let ((map (make-sparse-keymap))) + (define-key map [mode-line mouse-2] 'describe-mode) + (setq mode-line-major-mode-keymap map)) ;; Menu of minor modes. (let ((map (make-sparse-keymap))) + (define-key map [mode-line mouse-2] 'mode-line-minor-mode-help) (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1) (define-key map [header-line down-mouse-3] 'mode-line-mode-menu-1) (setq mode-line-minor-mode-keymap map)) @@ -292,8 +300,12 @@ Keymap to display on major and minor modes.") (setq-default mode-line-modes (list (propertize "%[(" 'help-echo help-echo) - `(:propertize ("" mode-name mode-line-process minor-mode-alist) - help-echo "mouse-3: minor mode menu" + `(:propertize ("" mode-name) + help-echo "mouse-2: help for current major mode" + local-map ,mode-line-major-mode-keymap) + `(:propertize ("" mode-line-process)) + `(:propertize ("" minor-mode-alist) + help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu" local-map ,mode-line-minor-mode-keymap) (propertize "%n" 'help-echo "mouse-2: widen" 'local-map (make-mode-line-mouse-map @@ -417,6 +429,12 @@ Menu of mode operations in the mode line.") (interactive "@e") (x-popup-menu event mode-line-mode-menu)) +(defun mode-line-minor-mode-help (event) + "Describe minor mode for EVENT occured on minor modes area of the mode line." + (interactive "@e") + (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. ; |