Gnus development mailing list
 help / color / mirror / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: ding@gnus.org
Subject: Best way to execute a function on article view?
Date: Wed, 19 Apr 2017 10:43:46 +0000	[thread overview]
Message-ID: <87wpagk85q.fsf@passepartout.tim-landscheidt.de> (raw)

Hi,

I have a function along the lines of:

| (gnus-with-article-buffer
|   (while (search-forward-regexp "^Alle Änderungen auf einen Blick:\n\\(https://de\\.wikipedia\\.org/w/index\\.php\\?title=.*&diff=0&oldid=[0-9]+\\)$" (point-max) t)
|     (browse-url (match-string 1)))
|   (gnus-summary-next-unread-article))

This searches the article for a URL and launches Firefox
(and moves to the next article).

Unfortunately this is somewhat orthogonal to my usual (most-
ly SPC-oriented) workflow for reading things.  I therefore
like to change my setup so that:

1. I select an article with SPC,
2. if the article contains such a URL, Gnus prompts me
   (y-or-n-p) if I want to browse that URL,
3. if I press SPC (which is "y" for y-or-n-p), the URL is
   browsed, and
4. if after that prompt I hit SPC again, the next unread ar-
   ticle is selected.

So in my "usual" workflow I wouldn't have to press anything
but SPC.

What is the best way to achieve that behaviour?  From a cur-
sory look at the manual, gnus-article-prepare-hook seems to
be the relevant hook.

Are there alternatives that are a better fit, for example a
washing function or something else?  One thing that would be
nice to have (additionally) is a similar behaviour to
gnus-summary-save-article (browse the URL in this article,
or in the next N, or in the previous - N, or in the articles
in the region, or in the marked articles (but in all but the
first case with no prompt)).

Tim




             reply	other threads:[~2017-04-19 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 10:43 Tim Landscheidt [this message]
2017-04-19 14:55 ` Eric Abrahamsen

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=87wpagk85q.fsf@passepartout.tim-landscheidt.de \
    --to=tim@tim-landscheidt.de \
    --cc=ding@gnus.org \
    /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).