info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Browsing to original article in gwene?


From: Kevin Brubeck Unhammer
Subject: Re: Browsing to original article in gwene?
Date: Mon, 08 Oct 2012 10:39:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Kevin Brubeck Unhammer <unhammer@fsfe.org> writes:

> Toke Høiland-Jørgensen <toke@toke.dk> writes:
>
>> Memnon Anon <gegendosenfleisch@googlemail.com> writes:
>>
>>> Something like this?
>>
>> I modified that function a tiny bit to make sure it doesn't throw an
>> error if an invalid buffer shows up in the list, and so it doesn't leave
>> the article unformatted if it can't find the archive-at header. It now
>> looks like this:
>
> […]
>
> Note that gnus has this handy macro `gnus-with-article-buffer' that lets
> you do away with the whole buffer-list loop:
>
> #+begin_src emacs-lisp
> (defun my-gnus-browse-gwene ()
>   "Start a browser for current gwene article"
>   (interactive)
>   (gnus-summary-show-article '(4))
>   (let ((url
>        (gnus-with-article-buffer
>          (goto-char (point-min))
>          (when (re-search-forward "^Archived-at: <\\(.*\\)>$" (point-max) 
> 'noerror)
>            (match-string 1)))))
>     (gnus-summary-show-article)
>     (if url
>       (browse-url url)
>       (message "Couldn't find any likely url"))))
> #+end_src
>
>
> Of course, if gnus had an even handier macro like
>
> #+begin_src emacs-lisp
> (defmacro gnus-with-raw-article-buffer (&rest forms)
>   `(progn
>      (gnus-summary-show-article '(4))
>      (prog1 (gnus-with-article-buffer ,@forms)
>        (gnus-summary-show-article))))
> #+end_src

Doh, Reiner Steib found the better solution with
gnus-original-article-buffer :-)

-- 
Kevin Brubeck Unhammer

GPG: 0x766AC60C

Attachment: pgpyy8C3XTKwn.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]