summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-12-07 06:47:32 +0100
committerStefan Kangas <stefan@marxist.se>2021-12-07 06:47:32 +0100
commitabf06a46b490be49f12f5509817cbb400c78bc6e (patch)
treefb1cb7da95a39ae2c92cc3f286a3ee153cc9e5b3 /lisp/progmodes
parentbdcf3c3504566fd61c42b06ee41cae5c074c3c03 (diff)
parentda23e607d33260c9aabaa3d136722a45457930dc (diff)
downloademacs-abf06a46b490be49f12f5509817cbb400c78bc6e.tar.gz
emacs-abf06a46b490be49f12f5509817cbb400c78bc6e.tar.bz2
emacs-abf06a46b490be49f12f5509817cbb400c78bc6e.zip
Merge from origin/emacs-28
da23e607d3 Select the right buffer for event in context-menu function...
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/prog-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 30b6edf0d9d..496b0810183 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -93,7 +93,9 @@
'mark-whole-buffer)
;; Include text-mode select menu only in strings and comments.
- (when (nth 8 (save-excursion (syntax-ppss (posn-point (event-end click)))))
+ (when (nth 8 (save-excursion
+ (with-current-buffer (window-buffer (posn-window (event-end click)))
+ (syntax-ppss (posn-point (event-end click))))))
(text-mode-context-menu menu click))
menu)