# HG changeset patch # User Stefan Monnier # Date 1207036571 0 # Node ID 13111c679e71817768d7ddec5770186f661afb20 # Parent 343109876a78c881dff6fef9238bcdbe65392a6b (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. diff -r 343109876a78 -r 13111c679e71 lisp/ChangeLog --- a/lisp/ChangeLog Tue Apr 01 07:25:42 2008 +0000 +++ b/lisp/ChangeLog Tue Apr 01 07:56:11 2008 +0000 @@ -1,3 +1,10 @@ +2008-04-01 Stefan Monnier + + * bindings.el (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. + 2008-04-01 Daiki Ueno * epa.el (epa-decrypt-region): Explain the reason why this diff -r 343109876a78 -r 13111c679e71 lisp/bindings.el --- a/lisp/bindings.el Tue Apr 01 07:25:42 2008 +0000 +++ b/lisp/bindings.el Tue Apr 01 07:56:11 2008 +0000 @@ -282,11 +282,14 @@ (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 @@ (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 @@ (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 @@ :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")