From: Reiner Steib <reinersteib+gmane@imap.cc>
To: ding@gnus.org
Subject: Re: .newsrc.eld should have one newline per group
Date: Thu, 06 Dec 2007 08:35:35 +0100 [thread overview]
Message-ID: <v97ijstgvs.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <m3hciw7msv.fsf@lugabout.jhcloos.org>
On Thu, Dec 06 2007, James Cloos wrote:
> In retrospect, I suppose one could add a call to the equivilent
> elisp to (gnus-save-newsrc-file) between each call to
> (gnus-gnus-to-quick-newsrc-format) and the ensuing call to
> (save-buffer) to accomplish one-line per group. Have fun with the
> regexp! And read the last paragraph of the docstring for
> (replace-regexp) for the proper idiom to use.
Here's what I use in `gnus-save-quick-newsrc-hook'. The pretty-print
variant has been discussed here, but IIRC it is quite slow.
;;;###autoload
(defun rs-gnus-save-newsrc-with-whitespace-1 ()
"Save ~/.newsrc.eld with extra whitespace."
(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)))
;; <oq1ykgajdm.fsf@carouge.sram.qc.ca>
(defun rs-gnus-save-newsrc-pretty-print ()
"Save pretty-printed ~/.newsrc.eld."
(gnus-message 5 "Pretty printing .newsrc.eld")
(let ((emacs-lisp-mode-hook nil))
(emacs-lisp-mode))
(pp-buffer)
(while (re-search-forward "(setq gnus-" nil t)
(replace-match "\n\\&" t))
;; (save-excursion
;; (goto-char (point-min))
;; (search-forward-regexp "(setq gnus-zombie-list")
;; (fill-region (point-at-bol) (point-max)))
(indent-region (point-min) (point-max))
(delete-trailing-whitespace))
(add-hook 'gnus-save-quick-newsrc-hook 'rs-gnus-save-newsrc-with-whitespace-1)
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
next prev parent reply other threads:[~2007-12-06 7:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-30 0:58 how to delete groups despite backend jidanni
2007-11-30 1:22 ` Dave Goldberg
2007-11-30 1:32 ` Katsumi Yamaoka
2007-12-03 0:02 ` .newsrc.eld should have one newline per group jidanni
2007-12-03 23:55 ` jidanni
2007-12-04 1:27 ` jidanni
2007-12-05 5:26 ` Michael Olson
2007-12-05 23:18 ` James Cloos
2007-12-06 7:35 ` Reiner Steib [this message]
2007-12-07 1:00 ` reader
2007-12-06 8:35 ` Daniel Pittman
2007-12-06 12:43 ` jidanni
2007-12-03 0:11 ` how to delete groups despite backend jidanni
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=v97ijstgvs.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).