unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable
@ 2021-12-17  7:25 Lars Ingebrigtsen
  2022-01-22 14:14 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-17  7:25 UTC (permalink / raw)
  To: 52566


It should be called from print_vectorlike (and any other places that
print unreadable objects, but I'm not sure there are any other places),
and should probably have a signature like

OBJECT PRINTCHARFUN ESCAPEFLAG

If it returns nil, the object should be printed as normal.

This can then be used to implement a `readablep' function (that would
bind this to a function that signals an error, and then catch that
error), and also to possibly make an alternative version of prin1 that
returns whether it printed something unprintable.


In GNU Emacs 29.0.50 (build 69, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
 of 2021-12-16 built on xo
Repository revision: e7a6d6a546e7e56e5a721aac86a19473e4303111
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Debian GNU/Linux bookworm/sid


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






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

* bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable
  2021-12-17  7:25 bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable Lars Ingebrigtsen
@ 2022-01-22 14:14 ` Lars Ingebrigtsen
  2022-01-22 14:48   ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-22 14:14 UTC (permalink / raw)
  To: 52566

Lars Ingebrigtsen <larsi@gnus.org> writes:

> It should be called from print_vectorlike (and any other places that
> print unreadable objects, but I'm not sure there are any other places),
> and should probably have a signature like
>
> OBJECT PRINTCHARFUN ESCAPEFLAG
>
> If it returns nil, the object should be printed as normal.
>
> This can then be used to implement a `readablep' function (that would
> bind this to a function that signals an error, and then catch that
> error), and also to possibly make an alternative version of prin1 that
> returns whether it printed something unprintable.

This has now been implemented in Emacs 29.  The function interface was
changed a bit, though.

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





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

* bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable
  2022-01-22 14:14 ` Lars Ingebrigtsen
@ 2022-01-22 14:48   ` Eli Zaretskii
  2022-01-22 15:25     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2022-01-22 14:48 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 52566

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sat, 22 Jan 2022 15:14:03 +0100
> 
> Lars Ingebrigtsen <larsi@gnus.org> writes:
> 
> > It should be called from print_vectorlike (and any other places that
> > print unreadable objects, but I'm not sure there are any other places),
> > and should probably have a signature like
> >
> > OBJECT PRINTCHARFUN ESCAPEFLAG
> >
> > If it returns nil, the object should be printed as normal.
> >
> > This can then be used to implement a `readablep' function (that would
> > bind this to a function that signals an error, and then catch that
> > error), and also to possibly make an alternative version of prin1 that
> > returns whether it printed something unprintable.
> 
> This has now been implemented in Emacs 29.  The function interface was
> changed a bit, though.

The doc string of print-unreadable-function and its documentation in
the manual seem to contradict each other.





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

* bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable
  2022-01-22 14:48   ` Eli Zaretskii
@ 2022-01-22 15:25     ` Lars Ingebrigtsen
  2022-01-22 15:36       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-22 15:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52566

Eli Zaretskii <eliz@gnu.org> writes:

> The doc string of print-unreadable-function and its documentation in
> the manual seem to contradict each other.

Better now?

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





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

* bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable
  2022-01-22 15:25     ` Lars Ingebrigtsen
@ 2022-01-22 15:36       ` Eli Zaretskii
  2022-01-22 15:46         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2022-01-22 15:36 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 52566

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 52566@debbugs.gnu.org
> Date: Sat, 22 Jan 2022 16:25:00 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > The doc string of print-unreadable-function and its documentation in
> > the manual seem to contradict each other.
> 
> Better now?

Not really.  Or am I missing something?

The doc string says:

  If this function returns nil, the object will be printed as usual.
  If it returns a string, that string will then be printed.  If the
  function returns anything else, the object will not be printed.

But the manual says:

  The function should return either @code{nil} (print nothing), or a
  string (which will be printed), or any other object (which means that
  the object should be printed normally).

The only thing these two agree upon is the case that the function
returns a string.  The other 2 possibilities are described
differently.





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

* bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable
  2022-01-22 15:36       ` Eli Zaretskii
@ 2022-01-22 15:46         ` Lars Ingebrigtsen
  2022-01-22 16:18           ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-22 15:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52566

Eli Zaretskii <eliz@gnu.org> writes:

> The doc string says:
>
>   If this function returns nil, the object will be printed as usual.
>   If it returns a string, that string will then be printed.  If the
>   function returns anything else, the object will not be printed.

Fixed now.

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





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

* bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable
  2022-01-22 15:46         ` Lars Ingebrigtsen
@ 2022-01-22 16:18           ` Eli Zaretskii
  2022-01-22 16:21             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2022-01-22 16:18 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 52566

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 52566@debbugs.gnu.org
> Date: Sat, 22 Jan 2022 16:46:55 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > The doc string says:
> >
> >   If this function returns nil, the object will be printed as usual.
> >   If it returns a string, that string will then be printed.  If the
> >   function returns anything else, the object will not be printed.
> 
> Fixed now.

Did you forget to push?





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

* bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable
  2022-01-22 16:18           ` Eli Zaretskii
@ 2022-01-22 16:21             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-22 16:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52566

Eli Zaretskii <eliz@gnu.org> writes:

> Did you forget to push?

Yup.

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





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

end of thread, other threads:[~2022-01-22 16:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17  7:25 bug#52566: 29.0.50; Wishlist: There should be a print-unreadable-function variable Lars Ingebrigtsen
2022-01-22 14:14 ` Lars Ingebrigtsen
2022-01-22 14:48   ` Eli Zaretskii
2022-01-22 15:25     ` Lars Ingebrigtsen
2022-01-22 15:36       ` Eli Zaretskii
2022-01-22 15:46         ` Lars Ingebrigtsen
2022-01-22 16:18           ` Eli Zaretskii
2022-01-22 16:21             ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).