# HG changeset patch # User Stefan Monnier # Date 1253151176 0 # Node ID 1eb4a432a8ae68f34789e6c55d9988e1d9a72aa9 # Parent c65e464f3acc327ca17f3fe9c8284b9936698420 (minor-mode-menu-from-indicator): Pay attention to :minor-mode-function (bug#4455). diff -r c65e464f3acc -r 1eb4a432a8ae lisp/ChangeLog --- 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 + + * mouse.el (minor-mode-menu-from-indicator): Pay attention + to :minor-mode-function (bug#4455). + 2009-09-16 Stefan Monnier * startup.el (command-line): Initialize the window-system after diff -r c65e464f3acc -r 1eb4a432a8ae lisp/mouse.el --- 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)