emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dialling down symbol escaping slightly?


From: Lars Ingebrigtsen
Subject: Dialling down symbol escaping slightly?
Date: Thu, 10 Mar 2022 03:47:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

In a bug report, Drew pointed out that a function like

(defun foo. ())

got a *Help* buffer like:

---
foo\. is a Lisp closure.

(foo\.)
---

This is because we're using prin1 (as we should) here, and because the
printer always adds a backslash before the dot.  You also get the same
thing with a question mark, which is perhaps a more serious usability
problem, because quite a few people like to use that convention for
predicates:

---
foo\? is a Lisp closure.
---

This isn't only for *Help*, of course, but in any context where we
display a symbol, like in backtraces and the like, where "foo\?" is
confusing and therefore less than optimal.

Now, as far as I can tell, the only symbol containing a dot that needs
to be escaped is the `.' symbol.  That is, it needs to be printed as
\. to differentiate between that and the dot operator in `(1 . 2)'.  As
for the question mark, it apparently only needs to be quoted when it's
the first character in a symbol (to differentiate between the symbol and
the character syntax).

Does anybody see any problems with tweaking the printer to drop escaping
"." and "?" (except in the two cases described above)?

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]