GNU bug report logs - #72434
[PATCH] Print list-ending comma/backquote forms specially

Previous Next

Package: emacs;

Reported by: Thuna <thuna.cing <at> gmail.com>

Date: Sat, 3 Aug 2024 01:32:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Thuna <thuna.cing <at> gmail.com>
To: 72434 <at> debbugs.gnu.org
Subject: bug#72434: [PATCH] Print list-ending comma/backquote forms specially
Date: Sat, 03 Aug 2024 03:31:28 +0200
[Message part 1 (text/plain, inline)]
(This patch follows from 72334, but that patch is not necessary for this
one to work.)

Currently something like the following (unevaluated) form:
  `(foo bar . ,baz)
prints as
  `(foo bar \, baz)
which, while technically accurate, is not helpful.  This comes up quite
often in pcase forms where a pattern like `(,head . ,_) is extremely
common.

This patch fixes that, such that if the tail of a list is a proper list
of two elements whose car is a backquote, comma, or comma-at (so ,foo
,@foo and `foo), and print-quoted is non-nil, the printed text will be
in the first form above.

Better ways to implement this are likely possible; this was simply the
easiest and quickest one.  Feel free to change the patch as needed.

[0001-Print-list-terminating-backquote-and-comma-forms-spe.patch (text/x-patch, attachment)]

This bug report was last modified 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.