Gnus development mailing list
 help / color / mirror / Atom feed
From: Alexander Baier <alexander.baier@mailbox.org>
To: Igor Sosa Mayor <joseleopoldo1792@gmail.com>
Cc: ding@gnus.org
Subject: Re: function to access raw article
Date: Fri, 31 Oct 2014 10:57:02 +0100	[thread overview]
Message-ID: <8738a4imtt.fsf@gmail.com> (raw)
In-Reply-To: <87fve4fwnc.fsf@gmail.com>

On 2014-10-31 09:53 Igor Sosa Mayor wrote:
> Alexander Baier <alexander.baier@mailbox.org> 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... <some fast growing number>" in the echo area and
hangs. When I press C-g I see a garbled summary buffer.

Regards,
-- 
Alexander Baier



  reply	other threads:[~2014-10-31  9:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31  8:29 Alexander Baier
2014-10-31  8:53 ` Igor Sosa Mayor
2014-10-31  9:57   ` Alexander Baier [this message]
2014-10-31 11:04     ` Steinar Bang
2014-10-31 11:43       ` Alexander Baier
2014-10-31 11:45       ` Igor Sosa Mayor
2014-10-31 11:50         ` Alexander Baier
2014-10-31 14:19     ` Eric Abrahamsen
2014-10-31 15:18       ` Alexander Baier
2014-10-31 15:29         ` Eric Abrahamsen
2014-10-31 12:55 ` Ted Zlatanov
2014-10-31 13:38   ` Alexander Baier
2014-10-31 14:01     ` Alexander Baier
2014-10-31 14:22     ` Peter Münster
2014-10-31 15:20       ` Alexander Baier

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=8738a4imtt.fsf@gmail.com \
    --to=alexander.baier@mailbox.org \
    --cc=ding@gnus.org \
    --cc=joseleopoldo1792@gmail.com \
    /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).