From 6b9510d94f814cacf43793dce76250b5f7e6f64a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Wed, 21 Jun 2023 11:03:14 +0200 Subject: [PATCH] Prefix syntax for ,@ in elisp-mode (bug#44418) * lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize): Use prefix syntax for ,@ to avoid the @ becoming part of a symbol that follows. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env): Propertise inserted Lisp code to keep the test working. --- lisp/progmodes/elisp-mode.el | 3 +++ test/lisp/emacs-lisp/edebug-tests.el | 1 + 2 files changed, 4 insertions(+) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 759b1ab4baf..955b708aee9 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -254,6 +254,9 @@ Comments in the form will be lost." ;; Empty symbol. ("##" (0 (unless (nth 8 (syntax-ppss)) (string-to-syntax "_")))) + ;; Prevent the @ from becoming part of a following symbol. + (",@" (0 (unless (nth 8 (syntax-ppss)) + (string-to-syntax "'")))) ;; Unicode character names. (The longest name is 88 characters ;; long.) ("\\?\\\\N{[-A-Za-z0-9 ]\\{,100\\}}" diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el index de2fff5ef19..28a7f38c576 100644 --- a/test/lisp/emacs-lisp/edebug-tests.el +++ b/test/lisp/emacs-lisp/edebug-tests.el @@ -116,6 +116,7 @@ back to the top level.") (with-current-buffer (find-file edebug-tests-temp-file) (read-only-mode) (setq lexical-binding t) + (syntax-ppss) (eval-buffer) ,@body (when edebug-tests-failure-in-post-command -- 2.39.2