From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18389 Path: news.gmane.org!.POSTED!not-for-mail From: Dave Abrahams Newsgroups: gmane.emacs.gnus.user Subject: A smart auto-wash? (was: washing and `article-translate-strings' in what hook?) Date: Thu, 29 Sep 2016 13:35:42 -0700 Message-ID: References: <87wpzruh9b.fsf@debian.uxu> <87iob8qo7i.fsf@debian.uxu> <87617768r9.fsf@bsb.me.uk> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1475181462 22635 195.159.176.226 (29 Sep 2016 20:37:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Sep 2016 20:37:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (darwin) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Thu Sep 29 22:37:38 2016 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpi55-0003Qg-6J for gegu-info-gnus-english@m.gmane.org; Thu, 29 Sep 2016 22:37:23 +0200 Original-Received: from localhost ([::1]:40227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpi54-0005VH-3d for gegu-info-gnus-english@m.gmane.org; Thu, 29 Sep 2016 16:37:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpi4w-0005Te-F7 for info-gnus-english@gnu.org; Thu, 29 Sep 2016 16:37:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpi4s-0000ue-6u for info-gnus-english@gnu.org; Thu, 29 Sep 2016 16:37:14 -0400 Original-Received: from [195.159.176.226] (port=45537 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpi4s-0000tq-00 for info-gnus-english@gnu.org; Thu, 29 Sep 2016 16:37:10 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bpi4a-0008MM-Fs for info-gnus-english@gnu.org; Thu, 29 Sep 2016 22:36:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:CxrxZHuglPsV+QYCR8WE3oPvxp8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: "info-gnus-english" Xref: news.gmane.org gmane.emacs.gnus.user:18389 Archived-At: More generally, I find I am constantly fiddling around with articles in Gnus to get them to be truly readable. *Many* need `W-Q'. The ones that only read well as HTML need `K-b K-v'. I found one today that was garbled without `K-m', which I had to find by experimentation. Has anybody written a smart washer that figures it out for you 99% of the time? on Mon Jun 01 2015, Ben Bacarisse wrote: > Emanuel Berg writes: > >> Ben Bacarisse writes: >> >>> I think you need to wrap the body in >>> >>> (gnus-with-article-buffer ...) >>> >>> This will have the added effect of making the >>> interactive function work from the summary buffer >>> window (provided there is a current article in some >>> buffer, of course). >> >> That's exactly right! >> >> But how is anyone to realize this? > > Ah, good question. I don't know. I learned what I know by reading > other people's code (some of it the Gnus sources). > >> Because there is no article argument to >> `article-translate-strings', the current article is >> all it can be applied to (?). So then shouldn't it say >> there is none, if there isn't? >> >> Or did this happen to some *other* article which >> I have been unaware of? > > That's possible. The code operates on the current buffer, so it was > probably editing something! > >> And why did it work calling it interactively but not >> doing the same from Lisp? >> Is `gnus-article-prepare-hook' the wrong place so at >> that time there isn't a buffer set to work >> on, interactively? > > I don't think the key distinction is interactive/non interactive. The > key issue is whether there is a "current buffer" which you can see > change. Selecting an article probably makes the article buffer current > so calling the function interactively works on the article you can see. > > -- -Dave