emacs-devel
[Top][All Lists]
Advanced

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

Re: `unreadablep'


From: Ihor Radchenko
Subject: Re: `unreadablep'
Date: Wed, 15 Dec 2021 18:20:23 +0800

Po Lu <luangruo@yahoo.com> writes:

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> I can see a use of adding extra argument to prin1. If the argument is
>> set, prin1 errors when attempting to print unreadable object or
>> alternatively prints nil (or other symbol) instead of the unreadable
>> object.
>
> Why an extra argument, and not a variable, say,
> `throw-printing-unreadably'?  There are many callers of prin1 that could
> benefit from this.

Variable would indeed be better. Using variable is more consistent with
the existing behaviour. prin1 can already be controlled by variables
like print-level, print-circle, etc

Though the name should probably start with print-. Maybe something like
print-unreadable (t by default, nil will make prin1 throw an error, and
'replace to print the value of print-unreadable-as instead of unreadable
object).

Yet another option may be not printing anything when print-unreadable is
t and throwing an error when print-unreadable is 'error, but I am not
sure if that much customisation is too much.

Best,
Ihor



reply via email to

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