Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
To: info-gnus-english@gnu.org
Subject: Re: Browsing to original article in gwene?
Date: Mon, 08 Oct 2012 08:46:18 +0200	[thread overview]
Message-ID: <87txu5folh.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <87fw5qj8o8.fsf@toke.dk>

On Sun, Oct 07 2012, Toke Høiland-Jørgensen wrote:

> #+begin_src emacs-lisp
> (defun my-gnus-browse-gwene ()
> "Start a browser for current gwene article"

AFAIK, Archived-at is not specific to Gwene.

>   (interactive)
>   (dolist (buf (buffer-list))
>     (when (buffer-live-p buf)
>       (with-current-buffer buf
>         (when (eq major-mode 'gnus-article-mode)

This might get the wrong article if `gnus-single-article-buffer' is
nil.

>           (gnus-summary-show-article '(4))

Use `gnus-original-article-buffer' ...

>           (switch-to-buffer buf)

... and `with-current-buffer'.

>           (goto-char (point-min))
>           (when (re-search-forward "^Archived-at: <\\(.*\\)>$" (point-max) t)

There is `gnus-fetch-field'.

>             (browse-url (match-string 1)))
>           (gnus-summary-show-article))))))
> #+end_src

I'd suggest something like this:

#+begin_src emacs-lisp
(defun rs-gnus-browse-archived-at ()
  "Browse \"Archived-at\" URL of the current article."
  (interactive)
  (let (url)
    (with-current-buffer gnus-original-article-buffer
      (setq url (gnus-fetch-field "Archived-at")))
    (if (not (stringp url))
	(gnus-message 1 "No \"Archived-at\" header found.")
      (setq url (gnus-replace-in-string url "^<\\|>$" ""))
      (browse-url url))))
#+end_src

Probably it should be expanded to handle process marked articles etc.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

  reply	other threads:[~2012-10-08  6:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05  2:05 Haider Rizvi
2012-10-05  4:25 ` William Gardella
2012-10-05  4:32   ` William Gardella
2012-10-05 13:25   ` Memnon Anon
2012-10-05 15:06     ` Haider Rizvi
2012-10-07 21:04     ` Toke Høiland-Jørgensen
2012-10-08  6:46       ` Reiner Steib [this message]
2012-10-08 16:10         ` Haider Rizvi
2012-10-08 17:07           ` Haider Rizvi
2012-10-08 19:11             ` Reiner Steib
2012-10-08  8:13       ` Kevin Brubeck Unhammer
2012-10-08  8:39         ` Kevin Brubeck Unhammer

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=87txu5folh.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=info-gnus-english@gnu.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).