Subject: bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings

From: Thuna <[email-masked]>
Date: Fri, 18 Nov 2022 16:12:45 +0100

Severity: wishlist

This is mostly useful for quoting Hyperspec glossary entries.  I only
patched it for Common Lisp to avoid possibly breaking help buffers for
elisp.

>From 9a22e65b102835244a3e529618cd1f1e735f5d60 Mon Sep 17 00:00:00 2001
From: Thuna <[email-masked]>
Date: Fri, 18 Nov 2022 15:56:38 +0100
Subject: [PATCH] Highlight multiple symbols in single quotes in Common Lisp
 strings

* lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2): When
multiple space-delimited symbols are single quoted together (e.g "`foo
bar'"), highlight them.
---
 lisp/emacs-lisp/lisp-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 7e39a77aed..1e1dbf3eb4 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -557,7 +557,7 @@ lisp-mode--search-key
          (,(concat "(" cl-errs-re "\\_>")
            (1 font-lock-warning-face))
          ;; Words inside ‘’ and `' tend to be symbol names.
-         (,(concat "[`‘]\\(" (rx lisp-mode-symbol) "\\)['’]")
+         (,(concat "[`‘]\\(" (rx (* lisp-mode-symbol (+ space)) lisp-mode-symbol) "\\)['’]")
           (1 font-lock-constant-face prepend))
          ;; Uninterned symbols, e.g., (defpackage #:my-package ...)
          ;; must come before keywords below to have effect
-- 
2.35.1