Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
To: ding@gnus.org
Subject: Re: Pretty-printing .newsrc.eld
Date: Thu, 14 Jun 2007 21:24:42 +0200	[thread overview]
Message-ID: <v9odji9w5h.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <b4m1wgfov16.fsf@jpl.org>

On Thu, Jun 14 2007, Katsumi Yamaoka wrote:

> (add-hook
>  'gnus-save-quick-newsrc-hook
>  (lambda nil
>    "Pretty print Lisp objects in the .newsrc.eld file."
[...]
>        (pp obj cur)))))
>
> It works, however it takes too much time and the ones it makes
> are not very easy to read. :<

I have the following poor man's pretty print in this hook:

(defun rs-gnus-save-newsrc-with-whitespace-1 ()
  "Save ~/.newsrc.eld with extra whitespace."
  ;; <oq1ykgajdm.fsf@carouge.sram.qc.ca>
  (gnus-message 5 "Adding whitespace to .newsrc.eld")
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward "(\\\"\\| ((\\| (nn" nil t)
      (replace-match "\n  \\&" t))
    (delete-trailing-whitespace)))

Additionally, I added newlines to make `forward-paragraph' work.  I
think this one could be installed in the trunk.

--8<---------------cut here---------------start------------->8---
--- gnus-start.el	7 Jun 2007 11:59:35 -0000	7.50
+++ gnus-start.el	14 Jun 2007 19:22:37 -0000
@@ -2866,7 +2866,7 @@
       (while variables
 	(when (and (boundp (setq variable (pop variables)))
 		   (symbol-value variable))
-	  (princ "(setq ")
+	  (princ "\n(setq ")
           (princ (symbol-name variable))
           (princ " '")
 	  (prin1 (symbol-value variable))
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




  reply	other threads:[~2007-06-14 19:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-10 17:30 Giorgos Keramidas
2007-06-14  7:27 ` Katsumi Yamaoka
2007-06-14 19:24   ` Reiner Steib [this message]
2007-06-15  6:59     ` Katsumi Yamaoka
2007-06-15 17:32       ` Reiner Steib
2007-06-16 11:31         ` Katsumi Yamaoka

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=v9odji9w5h.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=ding@gnus.org \
    /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.
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 NNTP newsgroup(s).