From 13d930deddd2e0529a0fb0f2fb93dd621d6d35be Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 23 Sep 2021 19:52:49 +0300 Subject: [PATCH] * lisp/mouse.el (context-menu-region): Use save-excursion for syntax-ppss. --- lisp/mouse.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/mouse.el b/lisp/mouse.el index 382c101159b..8ad3f7664a2 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -483,7 +483,8 @@ Some context functions add menu items below the separator." ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'defun)) :help "Mark the defun at click for a subsequent cut/copy")) (define-key-after submenu [mark-list-or-string] - `(menu-item ,(if (nth 8 (syntax-ppss (posn-point (event-end click)))) + `(menu-item ,(if (nth 8 (save-excursion + (syntax-ppss (posn-point (event-end click))))) "String" "List") ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'list-or-string)) :help "Mark list or string at click for a subsequent cut/copy")) -- 2.39.2