From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/85199 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 10:57:02 +0100 Message-ID: <8738a4imtt.fsf@gmail.com> References: <87fve4iqve.fsf@gmail.com> <87fve4fwnc.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414749575 2176 80.91.229.3 (31 Oct 2014 09:59:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2014 09:59:35 +0000 (UTC) Cc: ding@gnus.org To: Igor Sosa Mayor Original-X-From: ding-owner+M33443@lists.math.uh.edu Fri Oct 31 10:59:28 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 1Xk8zN-0001CI-2y for ding-account@gmane.org; Fri, 31 Oct 2014 10:59:26 +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 1Xk8yI-0000zG-Hw; Fri, 31 Oct 2014 04:58:18 -0500 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 1Xk8yF-0000yy-JV for ding@lists.math.uh.edu; Fri, 31 Oct 2014 04:58:15 -0500 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 1Xk8xj-00011w-Km for ding@lists.math.uh.edu; Fri, 31 Oct 2014 04:58:14 -0500 Original-Received: from mx2.mailbox.org ([80.241.60.215]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1Xk8xd-00065R-GM for ding@gnus.org; Fri, 31 Oct 2014 10:57:37 +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 17BE8456C8; Fri, 31 Oct 2014 10:57:32 +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 :date:date:references:subject:subject:from:from:received; s= mail20140220; t=1414749451; bh=xXX1TaJgUPSur+3wnCQOY8CrwrSSSYttJ eVWn0UgU6o=; b=q0y/uc1VfATRkOV+eBPfG1ng/mluM0CLkuF/21r0sIC1q6FsE q+qGR5g7R8yK3Z4uDKO7vTIV28EeemqHcRO8ds1alR1mHh6S8SwIERB0hoMSu6Zo 2Wp1ezGL8FsXftDoaykdtsHORJqvGrmZ7BHPiq+pkBpCWqXy6uyzISJBIcqSjIeL wk2PTJEnQLoUG0+yFwVHg10R+G4sPnQcg89/cGPYlD2sX+k+qGQk5TftjCDEWIZU QqTWWdtnOhv2CqK2WNqoPhIkFilNoNwt4Hjjm/Uss3Hny9OVK6qfj04uJCag3UHc aGfEaZYdY6LSuovuRNdjfPOuJDnYb7w0nV02uMAfL3mqqg7jDdOfwa06YNKaRWc/ DO9reBoXIGSDZl7eCVlST2OMLQBNXtYwVimOryDnfeM94qOXwRS1Z+1gMjNatCPm GKeh6uj6XGcwpqOTHHk+OBTDDMLSq333qFqS0tA4LYBq1ZWhso9HNNt4LrxQY2Pk lPZeM484gA0y+AfH1/ci2nAh30WYFMltPyAHPVkhIVaiWQoYDOouF/vMYhskh9Gl o29tTb54MlesQx5D9nE/zok/bSeaKSQMqCaki7kz65iA 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 hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTPS id Vvq_gft3Q7yS; Fri, 31 Oct 2014 10:57:31 +0100 (CET) Mail-Followup-To: Igor Sosa Mayor , ding@gnus.org User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) X-Spam-Score: -5.4 (-----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:85199 Archived-At: 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 If I enter a group with this function specified in the sumary-line-format I get the following messages in the *Messages* buffer: Error updating the summary line Can't find article 832 [2 times] Furthermore gnus displays "Hiding all threads... " in the echo area and hangs. When I press C-g I see a garbled summary buffer. Regards, -- Alexander Baier