From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64811 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Pretty-printing .newsrc.eld Date: Fri, 15 Jun 2007 15:59:05 +0900 Organization: Emacsen advocacy group Message-ID: References: <20070610173005.GA1276@kobe.laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181890874 26050 80.91.229.12 (15 Jun 2007 07:01:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Jun 2007 07:01:14 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13322@lists.math.uh.edu Fri Jun 15 09:01:12 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 1Hz5nv-0007y1-K1 for ding-account@gmane.org; Fri, 15 Jun 2007 09:01:07 +0200 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 1Hz5mi-0004NV-IO; Fri, 15 Jun 2007 01:59:52 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Hz5mg-0004NA-Cr for ding@lists.math.uh.edu; Fri, 15 Jun 2007 01:59:50 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1Hz5me-0000ew-So for ding@lists.math.uh.edu; Fri, 15 Jun 2007 01:59:50 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Hz5md-0007md-00 for ; Fri, 15 Jun 2007 08:59:47 +0200 Original-Received: from [66.225.201.151] (port=38764 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.63) (envelope-from ) id 1Hz5m4-0000N2-0Z for ding@gnus.org; Fri, 15 Jun 2007 01:59:12 -0500 X-Hashcash: 1:20:070615:ding@gnus.org::jhtyuq2+p9UabKXe:00005EZz X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:GUbRJqF5zMYJ2N2kYCvpgPWkBmk= X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.4 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64811 Archived-At: >>>>> In >>>>> Reiner Steib wrote: > On Thu, Jun 14 2007, Katsumi Yamaoka wrote: >> 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." This took 6 seconds while the rich man's version took 18 seconds (in the condition where: (length gnus-newsrc-alist) => 1552). > Additionally, I added newlines to make `forward-paragraph' work. I > think this one could be installed in the trunk. > --- 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)) It seems useful for a few people including me. ;-) Though it might be sufficient to such people to do that by a hook: (add-hook 'gnus-save-quick-newsrc-hook (lambda nil (goto-char (point-min)) (while (search-forward "\n(setq " nil t) (replace-match "\n\n(setq ")))) It took 0.012 seconds.