emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4492372: * lisp/textmodes/flyspell.el: Pop up the menu under curs


From: Juri Linkov
Subject: master 4492372: * lisp/textmodes/flyspell.el: Pop up the menu under cursor from keyboard.
Date: Mon, 22 Nov 2021 14:07:45 -0500 (EST)

branch: master
commit 44923722f42c2974c140e385c4c765f60944efe7
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * 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).
---
 lisp/textmodes/flyspell.el | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 258e5fd..2a9cae2 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]