Subject: bug#44418: 28.0.50; Spliced variable not matched as symbol in isearch

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 07 Jun 2022 19:45:16 +0200

Stefan Monnier <[email-masked]> writes:

> `@x` is a valid symbol, which is why `?@` is given symbol syntax.
> If we want to fix the above search we need to use
> `syntax-propertize-function` to change the syntax of those `@` that
> follow a comma.

The following seems to do the trick -- does this look OK to you?

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 77bf3f1ed1..210270bc67 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -245,6 +245,9 @@ elisp-mode-syntax-propertize
       ;; Empty symbol.
       ("##" (0 (unless (nth 8 (syntax-ppss))
                  (string-to-syntax "_"))))
+      ;; Give ,@ a prefix syntax.
+      (",@" (0 (unless (ppss-comment-or-string-start (syntax-ppss))
+                 (string-to-syntax "'"))))
       ;; Unicode character names.  (The longest name is 88 characters
       ;; long.)
       ("\\?\\\\N{[-A-Za-z0-9 ]\\{,100\\}}"

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no