Commit 97b952b7 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(minor-mode-menu-from-indicator): Pay attention

to :minor-mode-function (bug#4455).
parent f9af9719
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
......
......@@ -158,7 +158,8 @@ items `Turn Off' and `Help'."
(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 @@ items `Turn Off' and `Help'."
(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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment