From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64805 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Pretty-printing .newsrc.eld Date: Thu, 14 Jun 2007 16:27:33 +0900 Organization: Emacsen advocacy group Message-ID: References: <20070610173005.GA1276@kobe.laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1181806123 13311 80.91.229.12 (14 Jun 2007 07:28:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2007 07:28:43 +0000 (UTC) Cc: ding@gnus.org To: Giorgos Keramidas Original-X-From: ding-owner+M13316@lists.math.uh.edu Thu Jun 14 09:28:41 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 1Hyjl1-000769-MZ for ding-account@gmane.org; Thu, 14 Jun 2007 09:28:40 +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 1Hyjkg-0006Pu-R9; Thu, 14 Jun 2007 02:28:18 -0500 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 1Hyjke-0006PX-Ob for ding@lists.math.uh.edu; Thu, 14 Jun 2007 02:28:16 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1Hyjkd-0006Lk-4s for ding@lists.math.uh.edu; Thu, 14 Jun 2007 02:28:16 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Hyjkc-0003yZ-00 for ; Thu, 14 Jun 2007 09:28:14 +0200 Original-Received: from [66.225.201.151] (port=55720 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.63) (envelope-from ) id 1Hyjk2-0005ty-EQ; Thu, 14 Jun 2007 02:27:38 -0500 X-Hashcash: 1:20:070614:keramida@ceid.upatras.gr::c9E9LrvDqo0x04vx:00000000000000000000000000000000000004CuV X-Hashcash: 1:20:070614:ding@gnus.org::s/NqfSMUi0P4TEPo:00000uzr 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.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:YmbVBxurhiaiJUbqiHGQGkgh5k4= 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:64805 Archived-At: --=-=-= >>>>> In <20070610173005.GA1276@kobe.laptop> Giorgos Keramidas wrote: > this is probably not a Gnus-specific question, but it was > triggered after trying to search in my `.newsrc.eld' for > something, so if you can help that's fine, but if I should post > to another mailing list address that's fine too. > Is there any way to ``pretty-print'' my `.newsrc.eld' file? Intresting. I lost no time in trying it. Here it is: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (add-hook 'gnus-save-quick-newsrc-hook (lambda nil "Pretty print Lisp objects in the .newsrc.eld file." (goto-char (point-min)) (let ((cur (current-buffer)) obj end) (while (setq obj (condition-case nil (read cur) (error nil))) (skip-chars-forward "\t\n ") (setq end (point)) (forward-sexp -1) (delete-region (point) end) (pp obj cur))))) --=-=-= Content-Disposition: inline It works, however it takes too much time and the ones it makes are not very easy to read. :< [...] > ,----------------------------------------------------------------------- >| ("comp.lang.c" 3 ((1 . 595414) (595416 . 595423) 595426 595428 >| 595432 (595434 . 595435) 595439 >| (595441 . 595442) 595445 595447 >| (595452 . 595453) 595455 (595457 . 595458) >| 595470 595479 (595486 . 595487) >| (595495 . 595500) 595502 595507 >| (595510 . 595511) (595513 . 595515) >| 595518 595521 595523 595526 [...] > `----------------------------------------------------------------------- > But every time Gnus fires up and rewrites this file, it is saved > with the first format (i.e. lacking indentation). > Is there any way to make Gnus save `.newsrc.eld' using the second > style, i.e. something that it a wee bit easier to skim through > using `M-x view-mode' or similar? Maybe we need a better and faster function that replaces `pp'. --=-=-=--