Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: info-gnus-english@gnu.org
Subject: Re: Browsing to original article in gwene?
Date: Sun, 07 Oct 2012 23:04:23 +0200	[thread overview]
Message-ID: <87fw5qj8o8.fsf@toke.dk> (raw)
In-Reply-To: <87ipapt5mg.fsf@mean.albasani.net>


[-- Attachment #1.1: Type: text/plain, Size: 1405 bytes --]

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 #1.2: Type: application/pgp-signature, Size: 489 bytes --]

[-- Attachment #2: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

  parent reply	other threads:[~2012-10-07 21:04 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 [this message]
2012-10-08  6:46       ` Reiner Steib
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=87fw5qj8o8.fsf@toke.dk \
    --to=toke@toke.dk \
    --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).