Gnus development mailing list
 help / color / mirror / Atom feed
* how to delete groups despite backend
@ 2007-11-30  0:58 jidanni
  2007-11-30  1:22 ` Dave Goldberg
  2007-11-30  1:32 ` Katsumi Yamaoka
  0 siblings, 2 replies; 13+ messages in thread
From: jidanni @ 2007-11-30  0:58 UTC (permalink / raw)
  To: ding

Debugger entered--Lisp error: (error "This back end does not support group deletion")
  signal(error ("This back end does not support group deletion"))
  error("This back end does not support group deletion")
  gnus-group-delete-group("nndoc+/tmp/m4m:m4m" nil)
  call-interactively(gnus-group-delete-group)

So how does one delete it?

Open heart surgery on .newsrc.eld? But I don't have a doctors'
licence, and it squirms every time I tried to edit it, and last time I
think I accidently cut off its...



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: how to delete groups despite backend
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Dave Goldberg @ 2007-11-30  1:22 UTC (permalink / raw)
  To: ding

I think you want gnus-group-kill-group in this case.
-- 
Dave Goldberg
david.goldberg6@verizon.net




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: how to delete groups despite backend
  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  0:11   ` how to delete groups despite backend jidanni
  1 sibling, 2 replies; 13+ messages in thread
From: Katsumi Yamaoka @ 2007-11-30  1:32 UTC (permalink / raw)
  To: jidanni; +Cc: ding

>>>>> jidanni@jidanni.org wrote:

> Debugger entered--Lisp error: (error "This back end does not support group deletion")
>   signal(error ("This back end does not support group deletion"))
>   error("This back end does not support group deletion")
>   gnus-group-delete-group("nndoc+/tmp/m4m:m4m" nil)
>   call-interactively(gnus-group-delete-group)

> So how does one delete it?

I use `C-k', which only removes a group entry from the newsrc
database.  OTOH, `G DEL' also removes local files associated
with a group (if a user wants it).  A back end that has local
files that it exclusively uses has generally the group deletion
feature.  The reason that the nndoc back end does not offer the
group deletion feature is that files it uses are considered to
be not for only the back end.

cf. (info "(gnus)Back End Interface")



^ permalink raw reply	[flat|nested] 13+ messages in thread

* .newsrc.eld should have one newline per group
  2007-11-30  1:32 ` Katsumi Yamaoka
@ 2007-12-03  0:02   ` jidanni
  2007-12-03 23:55     ` jidanni
  2007-12-05  5:26     ` Michael Olson
  2007-12-03  0:11   ` how to delete groups despite backend jidanni
  1 sibling, 2 replies; 13+ messages in thread
From: jidanni @ 2007-12-03  0:02 UTC (permalink / raw)
  To: ding

Gentlemen, I propose instead of a paltry 13 newlines,
$ wc .newsrc.eld
    13  44047 859072 .newsrc.eld
we instead maintain .newsrc.eld with one newline per newsgroup, yes
lisp indented, but minimally.

You see sometimes there is just no other way to do some operations but
to edit .newsrc.eld, and in its present barf-blob form it squirms when
one tries to edit it.

Yes, one knows about .newsrc which is one newline per group, but
that's not what I'm talking about today.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: how to delete groups despite backend
  2007-11-30  1:32 ` Katsumi Yamaoka
  2007-12-03  0:02   ` .newsrc.eld should have one newline per group jidanni
@ 2007-12-03  0:11   ` jidanni
  1 sibling, 0 replies; 13+ messages in thread
From: jidanni @ 2007-12-03  0:11 UTC (permalink / raw)
  To: ding

KY> I use `C-k', which only removes a group entry from the newsrc
KY> database.

But is still is hiding in .newsrc.eld.

There is no other way to exorcise it from .newsrc.eld other than
editing it by hand.

P.S. maybe DISCARD (gnus-group-kill-group &optional N DISCARD)
would work, but who knows, as it is undocumented!

KY> The reason that the nndoc back end does not offer the
KY> group deletion feature is that files it uses are considered to
KY> be not for only the back end.

Gee, the local files were long gone anyway (/tmp). Too bad it can't
tell.

Anyway, gnus is thus not environmentally sound: can create groups but
not remove them.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: .newsrc.eld should have one newline per group
  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
  1 sibling, 1 reply; 13+ messages in thread
From: jidanni @ 2007-12-03 23:55 UTC (permalink / raw)
  To: ding

I swear yesterday,
j> $ wc .newsrc.eld
j>     13  44047 859072 .newsrc.eld
But today
       13   72252 1626238 .newsrc.eld

Thats' right, somehow the palpitating blob of a file doubled in size
overnight. Let's say we are curious about our sudden weight gain and
wish to take a look and see what part suddenly swelled up.

Even supposing that there was a backup kept, one couldn't use plain
diff(1) to find what group is causing the trouble, due to lack of
newlines.

As the blob of a file is almost as useless as a proprietary binary
format, it will be tough to find out why the file has doubled in size.

So adding a few newlines would be a tiny price to pay for increased
ease of inspection by many users.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: .newsrc.eld should have one newline per group
  2007-12-03 23:55     ` jidanni
@ 2007-12-04  1:27       ` jidanni
  0 siblings, 0 replies; 13+ messages in thread
From: jidanni @ 2007-12-04  1:27 UTC (permalink / raw)
  To: ding

I found the swelling:
$ perl -nwle '/^.............../;print length," $&"' .newsrc.eld
1541024 (setq gnus-zomb...

Probably caused by the deadly
  F runs the command gnus-group-find-new-groups
I should disable it.

Replaced it with
(setq gnus-zombie-list nil)
$ wc .newsrc.eld #more reasonable:
   13 14682 85384 .newsrc.eld



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: .newsrc.eld should have one newline per group
  2007-12-03  0:02   ` .newsrc.eld should have one newline per group jidanni
  2007-12-03 23:55     ` jidanni
@ 2007-12-05  5:26     ` Michael Olson
  2007-12-05 23:18       ` James Cloos
  1 sibling, 1 reply; 13+ messages in thread
From: Michael Olson @ 2007-12-05  5:26 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

jidanni@jidanni.org writes:

> Gentlemen, I propose instead of a paltry 13 newlines,
> $ wc .newsrc.eld
>     13  44047 859072 .newsrc.eld
> we instead maintain .newsrc.eld with one newline per newsgroup, yes
> lisp indented, but minimally.

I fully agree.  I recently had to selectively restore items from a
backed-up .newsrc.eld file, and Emacs took a long time to move around in
that file.

-- 
       Michael Olson -- FSF Associate Member #652     |
 http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net  |  /` |\ | | |
          Programmer -- Hobbies: Lisp, HCoop          | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: .newsrc.eld should have one newline per group
  2007-12-05  5:26     ` Michael Olson
@ 2007-12-05 23:18       ` James Cloos
  2007-12-06  7:35         ` Reiner Steib
                           ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: James Cloos @ 2007-12-05 23:18 UTC (permalink / raw)
  To: ding; +Cc: Michael Olson, jidanni

>>>>> "Jidanni" == <jidanni@jidanni.org> writes:
>>>>> "Michael" == Michael Olson <mwolson@member.fsf.org> 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 <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: .newsrc.eld should have one newline per group
  2007-12-05 23:18       ` James Cloos
@ 2007-12-06  7:35         ` Reiner Steib
  2007-12-07  1:00           ` reader
  2007-12-06  8:35         ` Daniel Pittman
  2007-12-06 12:43         ` jidanni
  2 siblings, 1 reply; 13+ messages in thread
From: Reiner Steib @ 2007-12-06  7:35 UTC (permalink / raw)
  To: ding

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/




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: .newsrc.eld should have one newline per group
  2007-12-05 23:18       ` James Cloos
  2007-12-06  7:35         ` Reiner Steib
@ 2007-12-06  8:35         ` Daniel Pittman
  2007-12-06 12:43         ` jidanni
  2 siblings, 0 replies; 13+ messages in thread
From: Daniel Pittman @ 2007-12-06  8:35 UTC (permalink / raw)
  To: ding

James Cloos <cloos+math_uh-ding@jhcloos.com> writes:

>>>>>> "Jidanni" == <jidanni@jidanni.org> writes:
>>>>>> "Michael" == Michael Olson <mwolson@member.fsf.org> 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 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.  

Actually, another option exists, which is to use the `pp' function and
friends to generate the formatted output.  This already takes care of
the formatting, ships in core Emacs and XEmacs, and is reasonable
efficient.

Regards,
        Daniel
-- 
Daniel Pittman <daniel@cybersource.com.au>           Phone: 03 9621 2377
Level 4, 10 Queen St, Melbourne             Web: http://www.cyber.com.au
Cybersource: Australia's Leading Linux and Open Source Solutions Company




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: .newsrc.eld should have one newline per group
  2007-12-05 23:18       ` James Cloos
  2007-12-06  7:35         ` Reiner Steib
  2007-12-06  8:35         ` Daniel Pittman
@ 2007-12-06 12:43         ` jidanni
  2 siblings, 0 replies; 13+ messages in thread
From: jidanni @ 2007-12-06 12:43 UTC (permalink / raw)
  To: ding

By the way,
pp.el barely documents usage. Emacs Info only has two lines about it too.
rs-gnus-save-newsrc-with-whitespace-1 and
rs-gnus-save-newsrc-pretty-print seem to produce about the same output.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: .newsrc.eld should have one newline per group
  2007-12-06  7:35         ` Reiner Steib
@ 2007-12-07  1:00           ` reader
  0 siblings, 0 replies; 13+ messages in thread
From: reader @ 2007-12-07  1:00 UTC (permalink / raw)
  To: ding

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> 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 ()

[...]

> (defun rs-gnus-save-newsrc-pretty-print ()

[...]

> (add-hook 'gnus-save-quick-newsrc-hook 'rs-gnus-save-newsrc-with-whitespace-1)

Is there some kind of way to unwind other elisp records that are keep
with no new lines?  Something like the agent group list that one can
access with `J C' g (When you have agentized groups)

I keep quite a few groups in there but change them fairly often.  I'd
like some way to edit that list by hand since when using the agent
tools provided like `J a' you can't tell what is or is not group
easily. 

Something that shows the groups one per line that can be edited and
resaved back to the agent record.




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-12-07  1:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).