GNU bug report logs - #34504
'pp' causally mentioned

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sat, 16 Feb 2019 19:35:02 UTC

Severity: wishlist

Tags: notabug

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34504 in the body.
You can then email your comments to 34504 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34504; Package emacs. (Sat, 16 Feb 2019 19:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 16 Feb 2019 19:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 'pp' causally mentioned
Date: Sun, 17 Feb 2019 03:33:50 +0800
In (info "(emacs) Program Indent") it says:
   Emacs also provides a Lisp pretty-printer in the ‘pp’ package, which
reformats Lisp objects with nice-looking indentation."

OK, as there is no hyperlink to click on, say the user eventually finds
that indeed there is
$ dlocate /pp\\.
emacs-el: /usr/share/emacs/26.1/lisp/emacs-lisp/pp.el.gz
and loads it, but he still cannot use it because there is no further
example of how, provided, even within that file. E.g., you could mention
how to pretty print one's .emacs with it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34504; Package emacs. (Sun, 17 Feb 2019 15:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 34504 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 34504 <at> debbugs.gnu.org
Subject: Re: bug#34504: 'pp' causally mentioned
Date: Sun, 17 Feb 2019 17:28:12 +0200
tags 34504 notabug
thanks

> From: 積丹尼 Dan Jacobson
> 	<jidanni <at> jidanni.org>
> Date: Sun, 17 Feb 2019 03:33:50 +0800
> 
> In (info "(emacs) Program Indent") it says:
>    Emacs also provides a Lisp pretty-printer in the ‘pp’ package, which
> reformats Lisp objects with nice-looking indentation."
> 
> OK, as there is no hyperlink to click on

In my version of the manual, that sentence is followed by a hyperlink:

     Emacs also provides a Lisp pretty-printer in the ‘pp’ package, which
  reformats Lisp objects with nice-looking indentation.  *Note pp:
  (elisp)Output Functions.

> say the user eventually finds
> that indeed there is
> $ dlocate /pp\\.
> emacs-el: /usr/share/emacs/26.1/lisp/emacs-lisp/pp.el.gz
> and loads it, but he still cannot use it because there is no further
> example of how, provided, even within that file. E.g., you could mention
> how to pretty print one's .emacs with it.

pp doesn't by itself pretty-print files, it can only pretty-print Lisp
objects (as the hyperlinked node of the ELisp manual describes).




Added tag(s) notabug. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 17 Feb 2019 15:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34504; Package emacs. (Sun, 17 Feb 2019 15:38:02 GMT) Full text and rfc822 format available.

Message #13 received at 34504 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 34504 <at> debbugs.gnu.org
Subject: Re: bug#34504: 'pp' causally mentioned
Date: Sun, 17 Feb 2019 23:37:29 +0800
OK it can only do objects, not a collection of objects, which is what I
suppose a file is. So how to pretty print one's .emacs file with it
might be mentioned as an exercise for the reader on that page.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34504; Package emacs. (Sun, 17 Feb 2019 17:55:02 GMT) Full text and rfc822 format available.

Message #16 received at 34504 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 34504 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#34504: 'pp' causally mentioned
Date: Sun, 17 Feb 2019 18:54:12 +0100
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> OK it can only do objects, not a collection of objects, which is what
> I suppose a file is. So how to pretty print one's .emacs file with it
> might be mentioned as an exercise for the reader on that page.

There's `pp-buffer'.  It's only a function, however.

Note that AFAIK, pp is nothing more as a very thin wrapper around the
standard Elisp printer that adds some additional line breaks, and even
that in a not very intelligent way.  A good pretty printer you could use
to prettify your .emacs still has to be written.


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34504; Package emacs. (Sun, 17 Feb 2019 18:46:02 GMT) Full text and rfc822 format available.

Message #19 received at 34504 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 34504 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#34504: 'pp' causally mentioned
Date: Mon, 18 Feb 2019 02:45:01 +0800
MH> There's `pp-buffer'.  It's only a function, however.
OK maybe tell the user to
M-: (pp-buffer)    [eval-expression]
C-x h              [mark-whole-buffer]
<tab>              [indent-for-tab-command]
Now one's lisp looks pretty good.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34504; Package emacs. (Sun, 17 Feb 2019 18:58:02 GMT) Full text and rfc822 format available.

Message #22 received at 34504 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 34504 <at> debbugs.gnu.org
Subject: Re: bug#34504: 'pp' causally mentioned
Date: Sun, 17 Feb 2019 20:57:00 +0200
> From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
> Cc: 34504 <at> debbugs.gnu.org
> Date: Sun, 17 Feb 2019 23:37:29 +0800
> 
> OK it can only do objects, not a collection of objects, which is what I
> suppose a file is.

No, a file is not a collection of objects, not unless you eval it.

> So how to pretty print one's .emacs file with it
> might be mentioned as an exercise for the reader on that page.

I don't think 'pp' is something that would support such an exercise.
IOW, I think you are looking for a feature in the wrong place.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34504; Package emacs. (Sun, 17 Feb 2019 23:02:02 GMT) Full text and rfc822 format available.

Message #25 received at 34504 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 34504 <at> debbugs.gnu.org
Subject: Re: bug#34504: 'pp' causally mentioned
Date: Mon, 18 Feb 2019 00:01:47 +0100
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> MH> There's `pp-buffer'.  It's only a function, however.
> OK maybe tell the user to
> M-: (pp-buffer)    [eval-expression]
> C-x h              [mark-whole-buffer]
> <tab>              [indent-for-tab-command]
> Now one's lisp looks pretty good.

In some cases it looks prettier, but in others it looks uglier.  For
example

#+begin_src emacs-lisp
(let ((x 1) (y 2))
  (+ x y))

(defun f (n) (1+ n))
#+end_src

becomes

#+begin_src emacs-lisp
(let
    ((x 1)
     (y 2))
  (+ x y))
(defun f
    (n)
  (1+ n))
#+end_src

after your treatment.  Too many added line breaks for my gusto, but OTOH
the empty line between the two expressions has disappeared.

pp may be ok for improving how an evaluation result is presented to the
user, but it's IMHO by far not suitable for reformatting hand-written
code.


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34504; Package emacs. (Mon, 18 Feb 2019 02:04:02 GMT) Full text and rfc822 format available.

Message #28 received at 34504 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 34504 <at> debbugs.gnu.org
Subject: Re: bug#34504: 'pp' causally mentioned
Date: Mon, 18 Feb 2019 10:03:15 +0800
(Well it helped for .newsrc.eld files.)




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Mon, 16 Sep 2019 03:04:01 GMT) Full text and rfc822 format available.

Notification sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
bug acknowledged by developer. (Mon, 16 Sep 2019 03:04:01 GMT) Full text and rfc822 format available.

Message #33 received at 34504-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 34504-done <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#34504: 'pp' causally mentioned
Date: Mon, 16 Sep 2019 05:03:04 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> tags 34504 notabug
> thanks
>
>> From: 積丹尼 Dan Jacobson
>>     <jidanni <at> jidanni.org>
>> Date: Sun, 17 Feb 2019 03:33:50 +0800
>>
>> In (info "(emacs) Program Indent") it says:
>>    Emacs also provides a Lisp pretty-printer in the ‘pp’ package, which
>> reformats Lisp objects with nice-looking indentation."
>>
>> OK, as there is no hyperlink to click on
>
> In my version of the manual, that sentence is followed by a hyperlink:
>
>      Emacs also provides a Lisp pretty-printer in the ‘pp’ package, which
>   reformats Lisp objects with nice-looking indentation.  *Note pp:
>   (elisp)Output Functions.
>
>> say the user eventually finds
>> that indeed there is
>> $ dlocate /pp\\.
>> emacs-el: /usr/share/emacs/26.1/lisp/emacs-lisp/pp.el.gz
>> and loads it, but he still cannot use it because there is no further
>> example of how, provided, even within that file. E.g., you could mention
>> how to pretty print one's .emacs with it.
>
> pp doesn't by itself pretty-print files, it can only pretty-print Lisp
> objects (as the hyperlinked node of the ELisp manual describes).

Already marked notabug, and from reading the discussion it doesn't look
like there's more to do here.  I'm therefore closing this bug.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 14 Oct 2019 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.