summaryrefslogtreecommitdiff
path: root/lisp/bindings.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-04-01 07:56:11 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-04-01 07:56:11 +0000
commit03b63ba9aa4b6d210d2b3f5d827682b5464ec773 (patch)
tree367785a67d239cb7278e7caa7e226df5c69e51b8 /lisp/bindings.el
parent8fe97050164698656ecadb836593ffd8feafa3d7 (diff)
downloademacs-03b63ba9aa4b6d210d2b3f5d827682b5464ec773.tar.gz
(mode-line-mode-menu): Move before (new) first use.
(mode-line-major-mode-keymap, mode-line-minor-mode-keymap): Bind the key directly to the menu. (mode-line-mode-menu-1, mode-line-mode-menu): Remove functions.
Diffstat (limited to 'lisp/bindings.el')
-rw-r--r--lisp/bindings.el26
1 files changed, 6 insertions, 20 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 59bb128d468..d1045002a04 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -282,11 +282,14 @@ buffer size, the line number and the column number.")
(defvar mode-line-modes nil
"Mode-line control for displaying major and minor modes.")
+(defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\
+Menu of mode operations in the mode line.")
+
(defvar mode-line-major-mode-keymap
(let ((map (make-sparse-keymap)))
(define-key map [mode-line down-mouse-1] 'mouse-major-mode-menu)
(define-key map [mode-line mouse-2] 'describe-mode)
- (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1)
+ (define-key map [mode-line down-mouse-3] mode-line-mode-menu)
map) "\
Keymap to display on major mode.")
@@ -294,8 +297,8 @@ Keymap to display on major mode.")
(let ((map (make-sparse-keymap)))
(define-key map [mode-line down-mouse-1] 'mouse-minor-mode-menu)
(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)
+ (define-key map [mode-line down-mouse-3] mode-line-mode-menu)
+ (define-key map [header-line down-mouse-3] mode-line-mode-menu)
map) "\
Keymap to display on minor modes.")
@@ -494,19 +497,6 @@ Switch to the most recently selected buffer other than the current one."
(select-window (posn-window (event-start event)))
(previous-buffer)))
-(defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\
-Menu of mode operations in the mode line.")
-
-(defun mode-line-mode-menu-1 (event)
- (interactive "e")
- (save-selected-window
- (select-window (posn-window (event-start event)))
- (let* ((selection (mode-line-mode-menu event))
- (binding (and selection (lookup-key mode-line-mode-menu
- (vector (car selection))))))
- (if binding
- (call-interactively binding)))))
-
(defmacro bound-and-true-p (var)
"Return the value of symbol VAR if it is bound, else nil."
`(and (boundp (quote ,var)) ,var))
@@ -560,10 +550,6 @@ Menu of mode operations in the mode line.")
:help "Automatically expand abbreviations"
:button (:toggle . abbrev-mode)))
-(defun mode-line-mode-menu (event)
- (interactive "@e")
- (x-popup-menu event mode-line-mode-menu))
-
(defun mode-line-minor-mode-help (event)
"Describe minor mode for EVENT on minor modes area of the mode line."
(interactive "@e")