From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/85209 Path: news.gmane.org!not-for-mail From: Alexander Baier Newsgroups: gmane.emacs.gnus.general Subject: Re: function to access raw article Date: Fri, 31 Oct 2014 16:18:44 +0100 Message-ID: <878ujwgtd7.fsf@mailbox.org> References: <87fve4iqve.fsf@gmail.com> <87fve4fwnc.fsf@gmail.com> <8738a4imtt.fsf@gmail.com> <877fzg2ug9.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414768815 32055 80.91.229.3 (31 Oct 2014 15:20:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2014 15:20:15 +0000 (UTC) Cc: ding@gnus.org To: Eric Abrahamsen Original-X-From: ding-owner+M33453@lists.math.uh.edu Fri Oct 31 16:20:08 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 1XkDzk-0007Vw-4m for ding-account@gmane.org; Fri, 31 Oct 2014 16:20:08 +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 1XkDz6-0003ws-3L; Fri, 31 Oct 2014 10:19:28 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1XkDz3-0003wc-70 for ding@lists.math.uh.edu; Fri, 31 Oct 2014 10:19:25 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1XkDz0-0007pb-VR for ding@lists.math.uh.edu; Fri, 31 Oct 2014 10:19:24 -0500 Original-Received: from mx2.mailbox.org ([80.241.60.215]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1XkDyx-0006WE-Uj for ding@gnus.org; Fri, 31 Oct 2014 16:19:20 +0100 Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 9E29843D6D; Fri, 31 Oct 2014 16:19:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-type:content-type:mime-version:user-agent:message-id :in-reply-to:date:date:references:subject:subject:from:from :received; s=mail20140220; t=1414768753; bh=awJneKcWDvmrgbJEHrI1 Icet7O9Jk2BJ8muY24F6NNc=; b=poR00qn4y1ywz7LKjRy+DJzrvUa18FJkEQ0R HvdPpmalUUd37DgwxrntGXcRvsI5nAksEVkVVYKvwU7s2DxaJrn8nUpTOzK9+LIr L+yvJUSqjBoiTnZT8RJxrYGraXd8ccQuJreUTWCw6PTwD4+sJ9MZgC5pgH6CYhAf 2KQ1y9eGEqAvMQylMTU1rwQ8RpXZGP9Us+3xW4sbO8h4ceyu+36917tuPcRs/IOx svJe8+3hOyiPmbrliTXKFBqVCONtUN02fGy0UxgPnHUAUFNmKolSCSUV0h0eVHzi dC/yk9a2paY6o/j34k6QiVA/BhOxDJws+SAiQ+6uCtU5np2ObYqExq7bP6X2ynUW sGPvP1E+7o/DJnrABrBsfPzeC39k+SOlrSs8JXRQlQvL8T0mRCnFZsXgADc/a8Au +fr8Wre6ZmmImt3Og9rdvyO6qdjkAFk0fo9SMVYJxYMk9WYZl0QifV8faWSXsYgt RYJCP/dkjWNo+xDXdRq3+NMkYKRjyLdZQyDhalxhz7kUVE0kRJ4oPQB5/u+/a52a PPy2nSegAaXtB4T3109HvwQHD07PPwGg18AYw33mfZ+bw X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp1.mailbox.org ([80.241.60.240]) (using TLS with cipher AES256-GCM-SHA384) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTPS id QRZgnGpHCQQd; Fri, 31 Oct 2014 16:19:13 +0100 (CET) Mail-Followup-To: Eric Abrahamsen , ding@gnus.org In-Reply-To: <877fzg2ug9.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 31 Oct 2014 07:19:02 -0700") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) X-Spam-Score: -5.6 (-----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:85209 Archived-At: On 2014-10-31 15:19 Eric Abrahamsen wrote: > Alexander Baier writes: > >> On 2014-10-31 09:53 Igor Sosa Mayor wrote: >>> Alexander Baier writes: >>> >>>> Hello, >>>> >>>> I want to access the raw (unwashed) version of an article from emacs >>>> lisp to search for a regexp. I do this in order to extract information >>>> from the body of the article to be used in the summary line. I used >>>> `gnus-summary-show-raw-article' which did not seem to work. What is the >>>> preferred way of doing this? >>> >>> I think gnus-summary-show-raw-article should work... >>> >>> But in any way, I don't think this is necessary to get the summary line >>> (do you mean 'subject')? What do you want to achieve exactly? >> >> I have information in the body of the the article that I want to display >> in the summary line. To do this, I wrote a function >> gnus-user-format-function-Y that extracts said information from the >> body. I then include %uY in my gnus-summary-line-format to include the >> information in the summary line. My current function looks like this: >> >> #+BEGIN_SRC emacs-lisp >> (defun gnus-user-format-function-Y (header) >> "Returns the title of a youtube video." >> (with-current-buffer gnus-article-buffer >> (gnus-summary-show-raw-article) >> (gnus-summary-select-article-buffer) >> (goto-char (point-min)) >> (search-forward-regexp "\n.*just uploaded a video\n\\(.*\\)\nhttp:.*") >> (match-string-no-properties 1))) >> #+END_SRC > > Try something like this: > > (when (buffer-live-p (get-buffer gnus-original-article-buffer)) > (with-current-buffer gnus-original-article-buffer > (goto-char (point-min)) > ;;etc > )) > > At any rate, I'm pretty sure you want to be using > gnus-original-article-buffer. I tried that and the buffer is never live. Thanks, -- Alexander Baier