diff options
| author | Juanma Barranquero | 2003-03-31 20:24:56 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-03-31 20:24:56 +0000 |
| commit | 8a42b33604147aa2e4678ac398492e17a86c7829 (patch) | |
| tree | 092f30a82fc38ab8d75773f4e7f0b94f08915d64 | |
| parent | 8e86406878ccfca4f3a2deaa7c2e76ea71532c15 (diff) | |
| download | emacs-8a42b33604147aa2e4678ac398492e17a86c7829.tar.gz emacs-8a42b33604147aa2e4678ac398492e17a86c7829.zip | |
(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.
| -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 @@ | |||
| 28 | ;;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 28 | ;;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 29 | ;;; Special formatting conventions are used in this file! | 29 | ;;; Special formatting conventions are used in this file! |
| 30 | ;;; | 30 | ;;; |
| 31 | ;;; a backslash-newline is used at the beginning of a documentation string | 31 | ;;; A backslash-newline is used at the beginning of a documentation string |
| 32 | ;;; when that string should be stored in the file etc/DOCnnn, not in core. | 32 | ;;; when that string should be stored in the file etc/DOCnnn, not in core. |
| 33 | ;;; | 33 | ;;; |
| 34 | ;;; Such strings read into Lisp as numbers (during the pure-loading phase). | 34 | ;;; 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.") | |||
| 256 | (defvar mode-line-modes nil | 256 | (defvar mode-line-modes nil |
| 257 | "Mode-line control for displaying major and minor modes.") | 257 | "Mode-line control for displaying major and minor modes.") |
| 258 | 258 | ||
| 259 | (defvar mode-line-major-mode-keymap nil "\ | ||
| 260 | Keymap to display on major mode.") | ||
| 261 | |||
| 259 | (defvar mode-line-minor-mode-keymap nil "\ | 262 | (defvar mode-line-minor-mode-keymap nil "\ |
| 260 | Keymap to display on major and minor modes.") | 263 | Keymap to display on minor modes.") |
| 264 | |||
| 265 | (let ((map (make-sparse-keymap))) | ||
| 266 | (define-key map [mode-line mouse-2] 'describe-mode) | ||
| 267 | (setq mode-line-major-mode-keymap map)) | ||
| 261 | 268 | ||
| 262 | ;; Menu of minor modes. | 269 | ;; Menu of minor modes. |
| 263 | (let ((map (make-sparse-keymap))) | 270 | (let ((map (make-sparse-keymap))) |
| 271 | (define-key map [mode-line mouse-2] 'mode-line-minor-mode-help) | ||
| 264 | (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1) | 272 | (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1) |
| 265 | (define-key map [header-line down-mouse-3] 'mode-line-mode-menu-1) | 273 | (define-key map [header-line down-mouse-3] 'mode-line-mode-menu-1) |
| 266 | (setq mode-line-minor-mode-keymap map)) | 274 | (setq mode-line-minor-mode-keymap map)) |
| @@ -292,8 +300,12 @@ Keymap to display on major and minor modes.") | |||
| 292 | (setq-default mode-line-modes | 300 | (setq-default mode-line-modes |
| 293 | (list | 301 | (list |
| 294 | (propertize "%[(" 'help-echo help-echo) | 302 | (propertize "%[(" 'help-echo help-echo) |
| 295 | `(:propertize ("" mode-name mode-line-process minor-mode-alist) | 303 | `(:propertize ("" mode-name) |
| 296 | help-echo "mouse-3: minor mode menu" | 304 | help-echo "mouse-2: help for current major mode" |
| 305 | local-map ,mode-line-major-mode-keymap) | ||
| 306 | `(:propertize ("" mode-line-process)) | ||
| 307 | `(:propertize ("" minor-mode-alist) | ||
| 308 | help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu" | ||
| 297 | local-map ,mode-line-minor-mode-keymap) | 309 | local-map ,mode-line-minor-mode-keymap) |
| 298 | (propertize "%n" 'help-echo "mouse-2: widen" | 310 | (propertize "%n" 'help-echo "mouse-2: widen" |
| 299 | 'local-map (make-mode-line-mouse-map | 311 | 'local-map (make-mode-line-mouse-map |
| @@ -417,6 +429,12 @@ Menu of mode operations in the mode line.") | |||
| 417 | (interactive "@e") | 429 | (interactive "@e") |
| 418 | (x-popup-menu event mode-line-mode-menu)) | 430 | (x-popup-menu event mode-line-mode-menu)) |
| 419 | 431 | ||
| 432 | (defun mode-line-minor-mode-help (event) | ||
| 433 | "Describe minor mode for EVENT occured on minor modes area of the mode line." | ||
| 434 | (interactive "@e") | ||
| 435 | (let ((indicator (car (nth 4 (car (cdr event)))))) | ||
| 436 | (describe-minor-mode-from-indicator indicator))) | ||
| 437 | |||
| 420 | ;; Add menu of buffer operations to the buffer identification part | 438 | ;; Add menu of buffer operations to the buffer identification part |
| 421 | ;; of the mode line.or header line. | 439 | ;; of the mode line.or header line. |
| 422 | ; | 440 | ; |