From: Juri Linkov Date: Mon, 22 Nov 2021 19:05:15 +0000 (+0200) Subject: * lisp/textmodes/flyspell.el: Pop up the menu under cursor from keyboard. X-Git-Tag: emacs-29.0.90~2852^2~96 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=44923722f42c2974c140e385c4c765f60944efe7;p=emacs.git * lisp/textmodes/flyspell.el: Pop up the menu under cursor from keyboard. * lisp/textmodes/flyspell.el (flyspell-emacs-popup): Use popup-menu-normalize-position with point when no mouse is involved, instead of the incorrect use of mouse-position (bug#52025). --- diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 258e5fde674..2a9cae29f79 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -2270,17 +2270,8 @@ If OPOINT is non-nil, restore point there after adjusting it for replacement." ;;*---------------------------------------------------------------------*/ (defun flyspell-emacs-popup (event poss word) "The Emacs popup menu." - (if (and (not event) - (display-mouse-p)) - (let* ((mouse-pos (mouse-position)) - (mouse-pos (if (nth 1 mouse-pos) - mouse-pos - (set-mouse-position (car mouse-pos) - (/ (frame-width) 2) 2) - (mouse-position)))) - (setq event (list (list (car (cdr mouse-pos)) - (1+ (cdr (cdr mouse-pos)))) - (car mouse-pos))))) + (unless event + (setq event (popup-menu-normalize-position (point)))) (let* ((corrects (flyspell-sort (car (cdr (cdr poss))) word)) (cor-menu (if (consp corrects) (mapcar (lambda (correct)