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: Toke Høiland-Jørgensen
Subject: Re: Browsing to original article in gwene?
Date: Sun, 07 Oct 2012 23:04:23 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux)

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:

#+begin_src emacs-lisp
(defun my-gnus-browse-gwene ()
"Start a browser for current gwene article"
  (interactive)
  (dolist (buf (buffer-list))
    (when (buffer-live-p buf)
      (with-current-buffer buf
        (when (eq major-mode 'gnus-article-mode)
          (gnus-summary-show-article '(4))
          (switch-to-buffer buf)
          (goto-char (point-min))
          (when (re-search-forward "^Archived-at: <\\(.*\\)>$" (point-max) t)
            (browse-url (match-string 1)))
          (gnus-summary-show-article))))))
#+end_src

I added the following to my gnus-summary-mode-hook to bind ctrl+enter to
run the function in gwene/gmane summary buffers, and unbind it otherwise
(this is not strictly necessary, but I figured I might want to use
ctrl+enter for something else in other buffers at some point...):

#+begin_src emacs-lisp
(if (string-match "g\\(we\\|ma\\)ne" (buffer-name))
  (local-set-key [(control return)] 'my-gnus-browse-gwene)
  (local-unset-key [(control return)]))
#+end_src

-Toke

-- 
Toke Høiland-Jørgensen
toke@toke.dk

Attachment: pgpncNm43MC0G.pgp
Description: PGP signature


reply via email to

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