Mercurial > emacs
changeset 105048:1eb4a432a8ae
(minor-mode-menu-from-indicator): Pay attention
to :minor-mode-function (bug#4455).
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 17 Sep 2009 01:32:56 +0000 |
parents | c65e464f3acc |
children | 4b7d5275d592 |
files | lisp/ChangeLog lisp/mouse.el |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Sep 16 20:36:54 2009 +0000 +++ b/lisp/ChangeLog Thu Sep 17 01:32:56 2009 +0000 @@ -1,3 +1,8 @@ +2009-09-17 Stefan Monnier <monnier@iro.umontreal.ca> + + * mouse.el (minor-mode-menu-from-indicator): Pay attention + to :minor-mode-function (bug#4455). + 2009-09-16 Stefan Monnier <monnier@iro.umontreal.ca> * startup.el (command-line): Initialize the window-system after
--- a/lisp/mouse.el Wed Sep 16 20:36:54 2009 +0000 +++ b/lisp/mouse.el Thu Sep 17 01:32:56 2009 +0000 @@ -158,7 +158,8 @@ (list (completing-read "Minor mode indicator: " (describe-minor-mode-completion-table-for-indicator)))) - (let ((minor-mode (lookup-minor-mode-from-indicator indicator))) + (let* ((minor-mode (lookup-minor-mode-from-indicator indicator)) + (mm-fun (or (get minor-mode :minor-mode-function) minor-mode))) (unless minor-mode (error "Cannot find minor mode for `%s'" indicator)) (let* ((map (cdr-safe (assq minor-mode minor-mode-map-alist))) (menu (and (keymapp map) (lookup-key map [menu-bar])))) @@ -167,10 +168,10 @@ (mouse-menu-non-singleton menu) `(keymap ,indicator - (turn-off menu-item "Turn Off minor mode" ,minor-mode) + (turn-off menu-item "Turn Off minor mode" ,mm-fun) (help menu-item "Help for minor mode" (lambda () (interactive) - (describe-function ',minor-mode)))))) + (describe-function ',mm-fun)))))) (popup-menu menu)))) (defun mouse-minor-mode-menu (event)