all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Dialling down symbol escaping slightly?
@ 2022-03-10  2:47 Lars Ingebrigtsen
  2022-03-10  5:50 ` [External] : " Drew Adams
  2022-03-10  6:46 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-10  2:47 UTC (permalink / raw)
  To: emacs-devel

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




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

end of thread, other threads:[~2022-03-14  9:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10  2:47 Dialling down symbol escaping slightly? Lars Ingebrigtsen
2022-03-10  5:50 ` [External] : " Drew Adams
2022-03-10  6:46 ` Eli Zaretskii
2022-03-10  6:50   ` Lars Ingebrigtsen
2022-03-10  6:53     ` Lars Ingebrigtsen
2022-03-11  3:44       ` Lars Ingebrigtsen
2022-03-14  9:29         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.