From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65897 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: .newsrc.eld should have one newline per group Date: Thu, 06 Dec 2007 08:35:35 +0100 Message-ID: References: <873auktzlo.fsf_-_@jidanni.org> <87k5ntsodd.fsf@grepfind.mwolson.org> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196926909 711 80.91.229.12 (6 Dec 2007 07:41:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2007 07:41:49 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14392@lists.math.uh.edu Thu Dec 06 08:41:59 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0BMs-0008J2-Um for ding-account@gmane.org; Thu, 06 Dec 2007 08:41:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1J0BLx-0002Cf-34; Thu, 06 Dec 2007 01:41:01 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1J0BLu-0002CK-N1 for ding@lists.math.uh.edu; Thu, 06 Dec 2007 01:40:58 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1J0BLn-00060D-Rr for ding@lists.math.uh.edu; Thu, 06 Dec 2007 01:40:58 -0600 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1J0BLk-0004Ns-00 for ; Thu, 06 Dec 2007 08:40:48 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1J0BLe-0000ov-ON for ding@gnus.org; Thu, 06 Dec 2007 07:40:42 +0000 Original-Received: from p54a96347.dip.t-dialin.net ([84.169.99.71]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Dec 2007 07:40:42 +0000 Original-Received: from Reiner.Steib by p54a96347.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Dec 2007 07:40:42 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 45 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p54a96347.dip.t-dialin.net X-Face: #vK]N[`vqjuod*|)'[iD7/"3AB-ApT%fmN"LWAg@oS7OesGv~)n[OBTLM#I="J'Y^-7I I/ps7o_'IK@#-Rs{::DZ@O8yS|fexe,XslY[:dNWOb~>?mC-&i_c)say:"\IpA.5U.b]'NY;Pks{lb h.+#6%DpZuaK3dcHB`Av3zc:r!C%~s0&m,tWj]&},qg.+0ww2gK%f!:GK|wMl.I!(voY*1"^li8"~B BNG)9LvPi?^DMR-GVDnZqhu*3Hi,+g=wFhI)BL6&u{EOVEHjVEVq~d?_}lMntWAc3(6?kftjc>_f>! g0wM(qPM$d5]^TT_Qyi&L?LGVG)SHN;Gk/,pkY9,~ Mail-Copies-To: nobody User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:jwb0sesagGbM6BkcG5EE2JncjaM= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65897 Archived-At: 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))) ;; (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/