From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87463 Path: news.gmane.org!.POSTED!not-for-mail From: Tim Landscheidt Newsgroups: gmane.emacs.gnus.general Subject: Best way to execute a function on article view? Date: Wed, 19 Apr 2017 10:43:46 +0000 Organization: http://www.tim-landscheidt.de/ Message-ID: <87wpagk85q.fsf@passepartout.tim-landscheidt.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1492598735 32417 195.159.176.226 (19 Apr 2017 10:45:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Apr 2017 10:45:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+m35684@lists.math.uh.edu Wed Apr 19 12:45:30 2017 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from mxfilter-048034.atla03.us.yomura.com ([107.189.48.34]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0n73-0008GZ-Rg for ding-account@gmane.org; Wed, 19 Apr 2017 12:45:29 +0200 X-Yomura-MXScrub: 1.0 Original-Received: from lists1.math.uh.edu (unknown [129.7.128.208]) by mxfilter-048034.atla03.us.yomura.com (Halon) with ESMTPS id 4fd832cc-24ed-11e7-8ed1-b499baa2b07a; Wed, 19 Apr 2017 10:45:33 +0000 (UTC) Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.87) (envelope-from ) id 1d0n5d-0004A9-Tl; Wed, 19 Apr 2017 05:44:01 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1d0n5a-00049T-1F for ding@lists.math.uh.edu; Wed, 19 Apr 2017 05:43:58 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1d0n5X-0000w9-HO for ding@lists.math.uh.edu; Wed, 19 Apr 2017 05:43:57 -0500 Original-Received: from [195.159.176.226] (helo=blaine.gmane.org) by quimby.gnus.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1d0n5W-0008AX-4J for ding@gnus.org; Wed, 19 Apr 2017 12:43:54 +0200 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d0n5P-00067k-E9 for ding@gnus.org; Wed, 19 Apr 2017 12:43:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 40 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:e2Y5yVXKFDIykHmaCxF9b4grMWA= List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87463 Archived-At: 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