Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: marc0@autistici.org (Marco Parrone (marc0))
Subject: resend via news
Date: Tue, 16 Dec 2003 04:02:15 +0100	[thread overview]
Message-ID: <87y8tdzcqw.fsf@marc0.dyndns.org> (raw)

Hi all.

I need a function for re-sending an article, one equivalent to
gnus-summary-resend-message, but for news instead of mail.

It is needed to implement a set of gateways on top of Gnus [1].

I've not found such a function, if it does not exists I will
cannibalize/generalize at least `message-resend' and
`gnus-summary-resend-message'.

I'm also wondering if there is a way to make local bindings for
functions too in elisp, so that it will be possible to write something
like:

  (let ((message-resend message-post-resend))
    (gnus-summary-resend-message ...))

so that the call to `message-resend' into the
`gnus-summary-resend-message' function body will call
`message-post-resend'.

Thanks,
marc0


1.

;; Warning: the following code is work-in-progress, as now it is
;; fragile, buggy, not meant to be used.
;;
;; FIXME!: make it resending the articles instead of forwarding them.
;;
(defun auto-forward (source dest)
  "auto-forward forwards all the new articles found in the source
group to the dest newsgroups.

The purpose of this function is to let to use
a properly configured Gnus as a mail-to-news gateway or
a rss-to-news gateway and alike.

For example, to forward articles from the `nnrss:bogus' group
to the `junk' newsgroup, use:

  (auto-forward \"nnrss:bogus\" \"junk\")
"
  (with-current-buffer "*Group*"
    (beginning-of-buffer)
    (if (search-forward source nil t)
	(progn
	  (gnus-group-select-group nil)
	  (with-current-buffer (concat "*Summary " source "*")
	    (beginning-of-buffer)
	    (while (search-forward-regexp "^ \\. \\[" nil t)
	      (gnus-summary-post-forward)
	      (with-current-buffer "*posting*"
		(insert dest)
		(message-send-and-exit))
	      (gnus-summary-mark-article-as-forwarded 
	       (gnus-summary-article-number)))
	    (gnus-summary-exit))))))

-- 
Marco Parrone (marc0) - marc0@autistici.org
2143 9E77 D5E6 115A 48AD  A170 D0EE F736 (4E88 99C2)


                 reply	other threads:[~2003-12-16  3:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87y8tdzcqw.fsf@marc0.dyndns.org \
    --to=marc0@autistici.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).