From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65892 Path: news.gmane.org!not-for-mail From: James Cloos Newsgroups: gmane.emacs.gnus.general Subject: Re: .newsrc.eld should have one newline per group Date: Wed, 05 Dec 2007 23:18:40 +0000 Message-ID: References: <873auktzlo.fsf_-_@jidanni.org> <87k5ntsodd.fsf@grepfind.mwolson.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196896775 29096 80.91.229.12 (5 Dec 2007 23:19:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2007 23:19:35 +0000 (UTC) Cc: Michael Olson , To: ding@gnus.org Original-X-From: ding-owner+M14387@lists.math.uh.edu Thu Dec 06 00:19:42 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 1J03Wn-0005xf-S0 for ding-account@gmane.org; Thu, 06 Dec 2007 00:19:42 +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 1J03WK-0008Bt-KD; Wed, 05 Dec 2007 17:19:12 -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 1J03WJ-0008Be-3t for ding@lists.math.uh.edu; Wed, 05 Dec 2007 17:19:11 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1J03WC-000328-Rp for ding@lists.math.uh.edu; Wed, 05 Dec 2007 17:19:10 -0600 Original-Received: from eagle.jhcloos.com ([207.210.242.212]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1J03W9-0004vq-00 for ; Thu, 06 Dec 2007 00:19:01 +0100 Original-Received: by eagle.jhcloos.com (Postfix, from userid 10) id 1269F40145; Wed, 5 Dec 2007 23:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jhcloos.com; s=eagle; t=1196896739; bh=33nEljYUZj6MqMSu9LtHpT9elwmmS4reb9Wsi0mC/ Ys=; h=X-Hashcash:From:To:Cc:Subject:In-Reply-To:References: User-Agent:Face:Copyright:OpenPGP:OpenPGP-Fingerprint:X-Hashcash: X-Hashcash:Date:Message-ID:Lines:MIME-Version:Content-Type; b=OFLP 97OUzpqqhSj0GteUq6R1TCN53J4NDegFp6rbgrS6uU//O+D0lOEF9CetIl0X4jETq9y tzHi0EXv6Yb8BaIKSf2PC7kzVe4XqZpX9fqi097ROalmemwfulwihu3XDpUuia7gd8k Va/MuiyCEHIM5wSnKu2YPqpWMACchLBVY= Original-Received: from lugabout.jhcloos.org (localhost [127.0.0.1]) by lugabout.jhcloos.org (Postfix) with ESMTP id 6AC36214082; Wed, 5 Dec 2007 23:18:43 +0000 (UTC) X-Hashcash: 1:23:071205:jidanni@jidanni.org::765LRMh2oSLG7AnO:0000000000000000000000000000000000000000007KGA In-Reply-To: <87k5ntsodd.fsf@grepfind.mwolson.org> (Michael Olson's message of "Wed, 05 Dec 2007 00:26:54 -0500") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAI1J REFUOE+lU9ESgCAIg64P1y+ngUdxhl5H8wFbbM0OmUiEhKkCYaZThXCo6KE5sCbA1DDX3genvO4d eBQgEMaM5qy6uWk4SfBYfdu9jvBN9nSVDOKRtwb+I3epboOsOX5pZbJNsBJFvmQQ05YMfieIBnYX FK2N6dOawd97r/e8RjkTLzmMsiVgrAoEugtviCM3v2WzjgAAAABJRU5ErkJggg== Copyright: Copyright 2007 James Cloos OpenPGP: ED7DAEA6; url=http://jhcloos.com/public_key/0xED7DAEA6.asc OpenPGP-Fingerprint: E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6 X-Hashcash: 1:23:071205:ding@gnus.org::QAnGrKm2sebUmmA4:00003cQN X-Hashcash: 1:23:071205:mwolson@member.fsf.org::H6BKwOoEZac4ML8G:000000000000000000000000000000000000000Hw61 Original-Lines: 60 X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65892 Archived-At: >>>>> "Jidanni" == writes: >>>>> "Michael" == Michael Olson writes: Jidanni> we instead maintain .newsrc.eld with one newline per newsgroup, Jidanni> yes lisp indented, but minimally. Michael> I fully agree. I recently had to selectively restore items Michael> from a backed-up .newsrc.eld file, and Emacs took a long time Michael> to move around in that file. I'd like to see that as well, but it isn't the easiest change to make. The current code uses (symbol-value) to get the value of each variable when writing out the (setq) lines into the buffer which gets written out to the ~/.nesrc.eld file. Emacs-lisp-mode has a (lisp-fill-paragraph) function, but that is more about filling comment blocks correctly; new code will be required which calls (fill-paragraph) will useful values for paragraph-start, et al and then runs (indent-sexp). The latter will force gnus to depend on lisp-mode.el. And you can probably imagine how slow saving will become if that has to be done every time. I don't beleive that is a viable option. The other alternative is to loop through gnus-newsrc-alist one value at a time, storing it in a temp variable and calling (symbol-value) on each of those. If you want to do that, you need to hack on gnus-start.el changing (gnus-gnus-to-quick-newsrc-format) to remove gnus-newsrc-alist from variables before calling the (while variables) loop. The (delq) call shows how; be sure to change both calls to gnus-variable-list. Then you can loop through (cdr gnus-newsrc-alist) and write out each entry with whatever indent you prefer. Be sure to end up with a proper (setq) call. Incidently, I use this on the ~/.newsrc.eld file before trying to edit it: perl -pe 's/\(\("/( ("/;s/ \("/\n ("/g' <~/.newsrc.eld >~/tmp/newsrc.el and then after editing and saving the temp file (~/newsrc.el above) I cat that file >~/.newsrc.eld. The first s/// adds a space between the parenthesis of the (setq)'s '(( opening; the second s/// adds a newline before each space+parent+quote trio. It works only because of the specific format of the newsrc alist, in that the (car) of each sexp in the alist starts with the group name as a quoted string. Hmmm. 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. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6