From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84039 Path: news.gmane.org!not-for-mail From: Haider Rizvi Newsgroups: gmane.emacs.gnus.general Subject: Re: From Elisp: Do stuff with article at point Date: Wed, 08 Jan 2014 12:22:53 -0500 Message-ID: References: <8761pvfpka.fsf@gmail.com> <87vbxua4hm.fsf@flea.lifelogs.com> <87eh4ie9pm.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1389202275 8796 80.91.229.3 (8 Jan 2014 17:31:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jan 2014 17:31:15 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32291@lists.math.uh.edu Wed Jan 08 18:31:18 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W0wyI-0005OS-Ow for ding-account@gmane.org; Wed, 08 Jan 2014 18:31:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1W0wxj-0006kp-Bf; Wed, 08 Jan 2014 11:30:39 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1W0wqT-0006iZ-VW for ding@lists.math.uh.edu; Wed, 08 Jan 2014 11:23:09 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1W0wqS-0000FZ-HL for ding@lists.math.uh.edu; Wed, 08 Jan 2014 11:23:09 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1W0wqQ-0001ul-BM for ding@gnus.org; Wed, 08 Jan 2014 18:23:06 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W0wqO-0004ve-NN for ding@gnus.org; Wed, 08 Jan 2014 18:23:04 +0100 Original-Received: from fw54.torolab.ibm.com ([199.246.40.54]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Jan 2014 18:23:04 +0100 Original-Received: from harizvi by fw54.torolab.ibm.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Jan 2014 18:23:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: fw54.torolab.ibm.com User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (darwin) Cancel-Lock: sha1:KmYnsyp6SjjpsdtN65b4W1HRVU4= X-Spam-Score: -1.1 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84039 Archived-At: Alexander Baier writes: > I do not want to save the article to disk, I merely want to do some > searching and copying in the buffer containing the article in > question. So I "just" need a fuction that gives me the buffer name > or buffer object of the current article at point, so that I can use > it with `with-current-buffer'. Sounds like the following may help you. I have coded ';' to my-gnus-browse in gnus-summary-mode-map, which is an overloaded function as follows. For the various scenarios, it tries to build an appropriate url from the article, and then browse-url it. (defun my-gnus-browse (arg) (interactive "p") (cond ((string-match ":\\(gwene\\|gmane\\)\\." gnus-newsgroup-name) (hr/gnus-browse-archived-at)) ((string-match "^nnrss\." gnus-newsgroup-name) (browse-nnrss-url arg)) ((string-match "^w3Forums\\|CommunitiesCategory\\|MyForums" gnus-newsgroup-name) (hr/gnus-browse-messageid-ibmconnections)) ((string-match "salpha" (mail-header-from gnus-current-headers)) (hr/gnus-browse-said-salpha)) )) ;; this came from the gnus manual, I believe (defun browse-nnrss-url( arg ) (interactive "p") (let ((url (assq nnrss-url-field (mail-header-extra (gnus-data-header (assq (gnus-summary-article-number) gnus-newsgroup-data)))))) (if url (progn (browse-url (cdr url)) (gnus-summary-mark-as-read-forward 1)) (gnus-summary-scroll-up arg)))) (add-to-list 'nnmail-extra-headers nnrss-url-field) (defun hr/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)))) Regards, -- Haider