bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#70868: 30.0.50; pp--insert-lisp prints small integers as characters


From: Michael Heerdegen
Subject: bug#70868: 30.0.50; pp--insert-lisp prints small integers as characters
Date: Sat, 11 May 2024 12:54:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

No Wayman <iarchivedmywholelife@gmail.com> writes:

> From the body of pp--insert-lisp in pp.el:
>
> ```emacs-lisp
> ;; Print some of the smaller integers as characters, perhaps?
> (integer
>  (if (<= ?0 sexp ?z)
>      (let ((print-integers-as-characters t))
>        (princ sexp (current-buffer)))
>    (princ sexp (current-buffer))))
> ```
>
> I stumbled on this behavior in a program of which pretty prints
> elisp forms as part of a report.
> I don't want characters when the input form originally included
> integers.
> Why do we do this here? The commentary doesn't offer any insight
> and sounds confused about the behavior, too.

No, this had been done intentionally of course - and AFAIU, the comment
only asks whether to include even more characters.

The code currently guesses which syntax is more likely to be satisfying.

> Is it worth making configurable, or outright removing?

We could make it configurable, but note that this will not avoid this
kind of problem: one and the same expression can include numbers in that
range that are "meant" as characters and others that are "meant" as
integers.  Characters being printed as integers is likewise annoying as
the opposite problem.

Anyway, adding a user option will probably be the best solution we can
implement.

Michael.





reply via email to

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