unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings
@ 2022-11-18 15:12 Thuna
  2022-11-24 23:53 ` Stefan Kangas
  0 siblings, 1 reply; 6+ messages in thread
From: Thuna @ 2022-11-18 15:12 UTC (permalink / raw)
  To: 59360

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

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.


[-- Attachment #2: the patch --]
[-- Type: text/x-patch, Size: 1234 bytes --]

From 9a22e65b102835244a3e529618cd1f1e735f5d60 Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings
  2022-11-18 15:12 bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings Thuna
@ 2022-11-24 23:53 ` Stefan Kangas
  2022-11-25 14:24   ` Thuna
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2022-11-24 23:53 UTC (permalink / raw)
  To: Thuna; +Cc: 59360

Thuna <thuna.cing@gmail.com> writes:

> 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.

For posterity, could you show (or link) an example of such a glossary
entry?

Thanks.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings
  2022-11-24 23:53 ` Stefan Kangas
@ 2022-11-25 14:24   ` Thuna
  2022-11-26  8:24     ` Stefan Kangas
  0 siblings, 1 reply; 6+ messages in thread
From: Thuna @ 2022-11-25 14:24 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 59360

> For posterity, could you show (or link) an example of such a glossary
> entry?

Some common examples that come to mind are `pathname designator',
`ordinary lambda list', and `generic function'.  These are glossary
entries so they don't have individual links.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings
  2022-11-25 14:24   ` Thuna
@ 2022-11-26  8:24     ` Stefan Kangas
  2022-11-26 12:20       ` Thuna
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2022-11-26  8:24 UTC (permalink / raw)
  To: Thuna; +Cc: 59360

Thuna <thuna.cing@gmail.com> writes:

>> For posterity, could you show (or link) an example of such a glossary
>> entry?
>
> Some common examples that come to mind are `pathname designator',
> `ordinary lambda list', and `generic function'.  These are glossary
> entries so they don't have individual links.

Thanks.  Would it risk being confusing to highlight them in the same way
as proper symbols, which also would have links?

Do you see any other drawbacks with this change?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings
  2022-11-26  8:24     ` Stefan Kangas
@ 2022-11-26 12:20       ` Thuna
  2022-12-03  0:58         ` Stefan Kangas
  0 siblings, 1 reply; 6+ messages in thread
From: Thuna @ 2022-11-26 12:20 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 59360

> Thanks.  Would it risk being confusing to highlight them in the same way
> as proper symbols, which also would have links?
I don't believe so, since it is already possible to have multiple
clashing meanings for symbols even without the glossary entry, for
example http://www.lispworks.com/documentation/HyperSpec/Body/a_string.htm.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings
  2022-11-26 12:20       ` Thuna
@ 2022-12-03  0:58         ` Stefan Kangas
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2022-12-03  0:58 UTC (permalink / raw)
  To: Thuna; +Cc: 59360

Thuna <thuna.cing@gmail.com> writes:

>> Thanks.  Would it risk being confusing to highlight them in the same way
>> as proper symbols, which also would have links?
> I don't believe so, since it is already possible to have multiple
> clashing meanings for symbols even without the glossary entry, for
> example http://www.lispworks.com/documentation/HyperSpec/Body/a_string.htm.

I would like to install the change, but where are we at with the
copyright assignment?  I think we are above the limit for the number of
contributions that we can accept from you without one, unfortunately.

I see that you discussed that with Lars in Bug#56345 in September.
Has there been any progress with that?

Thanks.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-03  0:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18 15:12 bug#59360: [PATCH] Highlight multiple symbols in single quotes in Common Lisp strings Thuna
2022-11-24 23:53 ` Stefan Kangas
2022-11-25 14:24   ` Thuna
2022-11-26  8:24     ` Stefan Kangas
2022-11-26 12:20       ` Thuna
2022-12-03  0:58         ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).