From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/15874 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Newsgroups: gmane.emacs.gnus.user Subject: Re: Browsing to original article in gwene? Date: Sun, 07 Oct 2012 23:04:23 +0200 Message-ID: <87fw5qj8o8.fsf@toke.dk> References: <87r4pdsfyh.fsf@gmail.com> <87ipapt5mg.fsf@mean.albasani.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4748462348529802420==" X-Trace: ger.gmane.org 1349644206 32177 80.91.229.3 (7 Oct 2012 21:10:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Oct 2012 21:10:06 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sun Oct 07 23:10:13 2012 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TKy72-0004cc-Fu for gegu-info-gnus-english@m.gmane.org; Sun, 07 Oct 2012 23:10:12 +0200 Original-Received: from localhost ([::1]:54064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKy6v-0000iz-Dx for gegu-info-gnus-english@m.gmane.org; Sun, 07 Oct 2012 17:10:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKy6r-0000hX-HI for info-gnus-english@gnu.org; Sun, 07 Oct 2012 17:10:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKy6q-0002YM-9E for info-gnus-english@gnu.org; Sun, 07 Oct 2012 17:10:01 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:41060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKy6q-0002YE-24 for info-gnus-english@gnu.org; Sun, 07 Oct 2012 17:10:00 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TKy6u-0004a3-Lp for info-gnus-english@gnu.org; Sun, 07 Oct 2012 23:10:04 +0200 Original-Received: from 1809ds4-ro.0.fullrate.dk ([90.184.46.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 07 Oct 2012 23:10:04 +0200 Original-Received: from toke by 1809ds4-ro.0.fullrate.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 07 Oct 2012 23:10:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 62 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 1809ds4-ro.0.fullrate.dk User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:IXZ+ubgzYyUSX65T4iIUfNJhMU8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:15874 Archived-At: --===============4748462348529802420== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Memnon Anon 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 =2DToke =2D-=20 Toke H=C3=B8iland-J=C3=B8rgensen toke@toke.dk --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAEBCAAGBQJQce5XAAoJEENeEGz1+utPItAH/RYMN9v9zFk1rA5701HC4A7y jFUqfFExbpXHTRE+APKYF9kAuCV3d9Pap7D5p/iS9C5tRrtQDMPHawEGtPo/15NL cRoibhfHDgbF4HW3Jw85lBCsdkpjyzz/Bb4uEbqA+fmcmLWfaUb8WNw036EVSZ07 Xyn8CW6lgE4iA9vewaOWNUexcqVIxXKM//Vg72DubTvdJcIvlpjGRTllrsE+H7e0 OTEWB1X+/7Vs/0sk9fZ3QyheBXU9K10AwJ8h+eUxFlN/Pxrdej2hKYDr2ZL2tvAI F4jUIQZQceN6cdexwrNEI3GLfGUYXbBZDII249wMsi34MHQmj1wSQ3S4GjyUcvk= =7FIk -----END PGP SIGNATURE----- --=-=-=-- --===============4748462348529802420== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english --===============4748462348529802420==--