diff options
| author | Glenn Morris | 2007-10-19 02:14:58 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-10-19 02:14:58 +0000 |
| commit | 7e4e9c66183a2a9b8dd16d1b0b3fc2d177b7393d (patch) | |
| tree | c4e6604600b6a3730fe0d8db6324241532a3968a | |
| parent | 0660eaf1f7ce874eaf09a54e3367caa0d9fca693 (diff) | |
| download | emacs-7e4e9c66183a2a9b8dd16d1b0b3fc2d177b7393d.tar.gz emacs-7e4e9c66183a2a9b8dd16d1b0b3fc2d177b7393d.zip | |
(mouse-minor-mode-menu, minor-mode-menu-from-indicator):
Move here from bindings.el
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/mouse.el | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 22868b19c03..c24221fa8cc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2007-10-19 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * bindings.el (mouse-minor-mode-menu) | ||
| 4 | (minor-mode-menu-from-indicator): Move to mouse.el. | ||
| 5 | * mouse.el (mouse-minor-mode-menu, minor-mode-menu-from-indicator): | ||
| 6 | Move here from bindings.el | ||
| 7 | |||
| 1 | 2007-10-19 Richard Stallman <rms@gnu.org> | 8 | 2007-10-19 Richard Stallman <rms@gnu.org> |
| 2 | 9 | ||
| 3 | * help-fns.el (describe-function-1): Don't use the advice origname | 10 | * help-fns.el (describe-function-1): Don't use the advice origname |
diff --git a/lisp/mouse.el b/lisp/mouse.el index 27c5dd901f7..82d12ccbdd0 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -151,6 +151,26 @@ PREFIX is the prefix argument (if any) to pass to the command." | |||
| 151 | ;; mouse-major-mode-menu was using `command-execute' instead. | 151 | ;; mouse-major-mode-menu was using `command-execute' instead. |
| 152 | (call-interactively cmd)))) | 152 | (call-interactively cmd)))) |
| 153 | 153 | ||
| 154 | (defun minor-mode-menu-from-indicator (indicator) | ||
| 155 | "Show menu, if any, for minor mode specified by INDICATOR. | ||
| 156 | Interactively, INDICATOR is read using completion." | ||
| 157 | (interactive (list (completing-read "Minor mode indicator: " | ||
| 158 | (describe-minor-mode-completion-table-for-indicator)))) | ||
| 159 | (let ((minor-mode (lookup-minor-mode-from-indicator indicator))) | ||
| 160 | (if minor-mode | ||
| 161 | (let* ((map (cdr-safe (assq minor-mode minor-mode-map-alist))) | ||
| 162 | (menu (and (keymapp map) (lookup-key map [menu-bar])))) | ||
| 163 | (if menu | ||
| 164 | (popup-menu menu) | ||
| 165 | (message "No menu for minor mode `%s'" minor-mode))) | ||
| 166 | (error "Cannot find minor mode for `%s'" indicator)))) | ||
| 167 | |||
| 168 | (defun mouse-minor-mode-menu (event) | ||
| 169 | "Show minor-mode menu for EVENT on minor modes area of the mode line." | ||
| 170 | (interactive "@e") | ||
| 171 | (let ((indicator (car (nth 4 (car (cdr event)))))) | ||
| 172 | (minor-mode-menu-from-indicator indicator))) | ||
| 173 | |||
| 154 | (defvar mouse-major-mode-menu-prefix) ; dynamically bound | 174 | (defvar mouse-major-mode-menu-prefix) ; dynamically bound |
| 155 | 175 | ||
| 156 | (defun mouse-major-mode-menu (event &optional prefix) | 176 | (defun mouse-major-mode-menu (event &optional prefix) |