all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 63861@debbugs.gnu.org
Subject: bug#63861: [PATCH] pp.el: New "pretty printing" code
Date: Sat, 17 Jun 2023 19:42:44 +0300	[thread overview]
Message-ID: <83ttv6oxa3.fsf@gnu.org> (raw)
In-Reply-To: <jwvlegioyr6.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Sat, 17 Jun 2023 12:13:54 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: 63861@debbugs.gnu.org
> Date: Sat, 17 Jun 2023 12:13:54 -0400
> 
> >> +@defun pp object-or-beg &optional stream-or-end
> >> +This function indents and fills the printed representation of an
> >> +object (typically representing ELisp code) to make it more readable
> >> +for humans.
> >> +
> >> +It accepts two calling conventions: if called with two integers
> >> +@var{beg} and @var{end}, it indents and fills the corresponding
> >> +region, presumably containing the printed representation of one or
> >> +more objects, otherwise it takes a @var{object} and an optional
> >> +@var{stream}, and prints @var{object} like @code{prin1}, but does it
> >> +in a prettier way.
> >
> > This text references arguments like @var{object} that are named
> > differently in the @defun line.
> 
> Indeed.  Assuming you understood what I meant to say, do you have
> a recommendation of how to write it?

Something like this:

  The function can be called to pretty-print either a region of text,
  presumably containing the printed representation of one or more
  objects, or to pretty-print an object.  In the first case, the
  function must be called with 2 arguments, @var{object-or-beg} and
  @var{stream-or-end}, which are integer buffer positions that define
  the region; in the second case, @var{object-or-beg} is the object to
  print and @var{stream-or-end} is the stream to which to print it,
  which defaults to @code{standard-output} if nil or omitted.

> Or maybe, I should leave `pp` alone and add a new `pp-region`
> function instead instead of combining two different calling conventions
> on a single function?

That might be better, indeed, both for documentation and for usage.





  reply	other threads:[~2023-06-17 16:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02 22:50 bug#63861: [PATCH] pp.el: New "pretty printing" code Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03  5:53 ` Eli Zaretskii
2023-06-03 18:18   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03 18:58     ` Eli Zaretskii
2023-06-12 20:21       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-13 10:55         ` Eli Zaretskii
2023-06-16 18:26           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-17  5:39             ` Eli Zaretskii
2023-06-17 16:13               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-17 16:42                 ` Eli Zaretskii [this message]
2023-06-17 22:08                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04  3:25     ` Visuwesh
2023-06-07 15:48       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09  3:21         ` Visuwesh
2023-06-09 14:59           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09 15:09             ` Ihor Radchenko
2023-06-09 15:26               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09 15:59                 ` Visuwesh
2023-06-09 16:04             ` Visuwesh
2023-06-05 16:12     ` Juri Linkov
2023-06-07 15:21       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-07 18:12         ` Juri Linkov
2023-06-07 19:43           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-07 14:10 ` Thierry Volpiatto
2023-06-07 15:27   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-07 16:19     ` Thierry Volpiatto
2023-06-07 21:18       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-08 16:15   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-08 18:08     ` Thierry Volpiatto
2023-06-08 22:35       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09  0:07         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09  5:22         ` Thierry Volpiatto
2023-06-20 20:56         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ttv6oxa3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63861@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.