]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/mouse.el (context-menu-region): Use save-excursion for syntax-ppss.
authorJuri Linkov <juri@linkov.net>
Thu, 23 Sep 2021 16:52:49 +0000 (19:52 +0300)
committerJuri Linkov <juri@linkov.net>
Thu, 23 Sep 2021 16:52:49 +0000 (19:52 +0300)
lisp/mouse.el

index 382c101159b8dac89116d1cc4abea167a3ddcedd..8ad3f7664a200a5131aea1b36f5a511a0959f2e7 100644 (file)
@@ -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"))