* lisp/mouse.el (context-menu-open): Call interactively a command
returned by `context-menu-map' such as `flyspell-correct-word' (bug#50067).
* lisp/textmodes/flyspell.el (flyspell-correct-word): Handle the
case when it's called by a key bound to `context-menu-open'.
Then it should work the same way as `C-c $' typed on misspelled word
where the arg `event' of `flyspell-correct-word-before-point' is nil.
"Start key navigation of the context menu.
This is the keyboard interface to \\[context-menu-map]."
(interactive)
- (let ((inhibit-mouse-event-check t))
- (popup-menu (context-menu-map) (point))))
+ (let ((inhibit-mouse-event-check t)
+ (map (context-menu-map)))
+ (if (commandp map)
+ (call-interactively map)
+ (popup-menu map (point)))))
(global-set-key [S-f10] 'context-menu-open)
(interactive "e")
(let ((save (point)))
(mouse-set-point event)
- (flyspell-correct-word-before-point event save)))
+ (flyspell-correct-word-before-point (and (consp event) event) save)))
(defun flyspell-correct-word-before-point (&optional event opoint)
"Pop up a menu of possible corrections for misspelled word before point.