summaryrefslogtreecommitdiff
path: root/lisp/textmodes/flyspell.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-11-22 21:05:15 +0200
committerJuri Linkov <juri@linkov.net>2021-11-22 21:07:08 +0200
commit44923722f42c2974c140e385c4c765f60944efe7 (patch)
tree84c9c5dc1cbbcd9dc091d3fc0d9b5076b8820267 /lisp/textmodes/flyspell.el
parent0601afcf7c6c3498df010cef1511c38f254cbbf8 (diff)
downloademacs-44923722f42c2974c140e385c4c765f60944efe7.tar.gz
emacs-44923722f42c2974c140e385c4c765f60944efe7.tar.bz2
emacs-44923722f42c2974c140e385c4c765f60944efe7.zip
* 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).
Diffstat (limited to 'lisp/textmodes/flyspell.el')
-rw-r--r--lisp/textmodes/flyspell.el13
1 files changed, 2 insertions, 11 deletions
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)