Gnus development mailing list
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: Re: easiest way to subscribe to 10 groups at once
Date: Tue, 07 Oct 2008 10:31:07 -0500	[thread overview]
Message-ID: <86y710v2v8.fsf@lifelogs.com> (raw)
In-Reply-To: <87myhh2qrs.fsf@jidanni.org>

On Tue, 07 Oct 2008 08:27:35 +0800 jidanni@jidanni.org wrote: 

j> This step was easy enough:
j> # xargs -n 1 noffle -s < additional_groups_I_want_to_subscribe_to
j> Next I attempted to use
j> F runs the command gnus-group-find-new-groups
j> which merely chomped CPU and made a giant buffer in the buffer list,
j> until I hit ^G. No wonder F is disabled.
j> (As I don't use .newsrc, I didn't investigate importing from there.)
j> OK, then I did
j> # perl -nlwe 'print "(gnus-group-jump-to-group \"$_\")"' < additional_groups...
j> (gnus-group-jump-to-group "gmane.comp.handhelds.openmoko.announce")
j> (gnus-group-jump-to-group "gmane.comp.handhelds.openmoko.apps")
j> (gnus-group-jump-to-group "gmane.comp.handhelds.openmoko.buglog")...
j> Which I pasted into the minibuffer of
j> M-: (translated from <escape> :) runs the command eval-expression
j> whereupon I was finally able to use uuuuu... to subscribe them. Jeez.

It seems useful to have a "mapfile" function similar to mapcar which
would feed every line from a file into a list and then mapcar on the
list.  Something like this:

(defun file-to-list (file)
  "Get contents of FILE as a list of nonempty strings.
Blank lines are skipped."
  (with-temp-buffer
    (let ((list))
      (insert-file-contents file)
      (while (not (eobp))
	(let ((line (buffer-substring (line-beginning-position) (line-end-position))))
	  (when (< 0 (length line))
	    (push line list)))
	(forward-line))
      list)))

(defun mapfile (function file)
  (mapcar function (file-to-list file)))

(mapfile 'insert "/etc/hosts") ; side effect--insert every line as a string

I don't know if my version is optimal (for large files it's definitely
not), but it seems generally a very useful idea.

Ted




  reply	other threads:[~2008-10-07 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-07  0:27 jidanni
2008-10-07 15:31 ` Ted Zlatanov [this message]
2008-10-07 18:23 ` Adam Sjøgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y710v2v8.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).