aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2021-09-23 19:52:49 +0300
committerJuri Linkov2021-09-23 19:52:49 +0300
commit13d930deddd2e0529a0fb0f2fb93dd621d6d35be (patch)
treef9e8276a2804ef14535860aad2b54052e8496fc7
parent5d96fad27863497a427c80550070e435a4c9e0d9 (diff)
downloademacs-13d930deddd2e0529a0fb0f2fb93dd621d6d35be.tar.gz
emacs-13d930deddd2e0529a0fb0f2fb93dd621d6d35be.zip
* lisp/mouse.el (context-menu-region): Use save-excursion for syntax-ppss.
-rw-r--r--lisp/mouse.el3
1 files changed, 2 insertions, 1 deletions
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."
483 ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'defun)) 483 ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'defun))
484 :help "Mark the defun at click for a subsequent cut/copy")) 484 :help "Mark the defun at click for a subsequent cut/copy"))
485 (define-key-after submenu [mark-list-or-string] 485 (define-key-after submenu [mark-list-or-string]
486 `(menu-item ,(if (nth 8 (syntax-ppss (posn-point (event-end click)))) 486 `(menu-item ,(if (nth 8 (save-excursion
487 (syntax-ppss (posn-point (event-end click)))))
487 "String" "List") 488 "String" "List")
488 ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'list-or-string)) 489 ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'list-or-string))
489 :help "Mark list or string at click for a subsequent cut/copy")) 490 :help "Mark list or string at click for a subsequent cut/copy"))