From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18928 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Damien Collard Newsgroups: gmane.emacs.gnus.user Subject: Treat article body iff header matches predicate? Date: Wed, 20 Mar 2019 11:30:49 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="169335"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Wed Mar 20 11:48:25 2019 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6Yli-000hqs-0j for gegu-info-gnus-english@m.gmane.org; Wed, 20 Mar 2019 11:48:22 +0100 Original-Received: from localhost ([127.0.0.1]:45931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6Ylg-0007Dl-Nm for gegu-info-gnus-english@m.gmane.org; Wed, 20 Mar 2019 06:48:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6YgT-00031x-Ay for info-gnus-english@gnu.org; Wed, 20 Mar 2019 06:42:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6YUo-0003PE-1o for info-gnus-english@gnu.org; Wed, 20 Mar 2019 06:30:54 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:45269) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6YUn-0003H7-FN for info-gnus-english@gnu.org; Wed, 20 Mar 2019 06:30:53 -0400 X-Originating-IP: 82.243.113.37 Original-Received: from FataMorgana (tou31-2-82-243-113-37.fbx.proxad.net [82.243.113.37]) (Authenticated sender: damien.collard@distfp.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id B5B4FE0011 for ; Wed, 20 Mar 2019 10:30:49 +0000 (UTC) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEXamX/28r34+frw9ONc Nxl4bnZiOH0iAAAAB3RJTUUHsQwfFzs7RBhzUQAAAi1JREFUOI1llMF2ozAMRaXB7K247BM4 3QNq9mQq780E/v9X5slJm7TJghN0LfnpWYb6x29snl7o8XfY8vwKtO/fzf69gJknDWafv8HA FFvLH39/g9PKMu2Xj5dSIyeRyOEFRJ1EJNjhFxhYVSKFrHPV9w2OY0xcJC7Hg477/AAkysQS 8zm1XffnGwzXwzCScLQ27hy/wJHG63xEFxy3hZoH2MzWGXbYKsL8AINh7fyezS4QxsxyB6PZ wvPbVoG0VIRv4N2EWBEHQJyIu/kGch9ZzEGK2AbW1Fp0NArMDq6ySQXX780bddCcswiBlLnK DQ6wR9ZtgWBP2YkS9ac9X/TNjCfLsN6LuRRYMuxX1ZiUN9utgoh9K0iqOo3LluMuT0AJcUlu TdfGSgz99EMsWI9Vhla7J3BiQSlvEaI6upfyjF2wd65m4RAddA6GSJImF+iKqikxLAAjXhMG pG3NJ4jjitGrGdSKTt2CKhghWtGdp7tcAJ1Q4joJtQtAoeCdD6uLwow0Ny+gDgAZo0gFpCK7 LSFUALnSfVbAACV48AYGohWNr5HxLK7nC6wYdYQiuhlpuQM0gsn1rlqMaTpzCXfQkl8ODJMf XQpC94x9cSAjrwXaukt1CcDKAeCkI5XMGrcGs+ggLHOd9pPEtmSy1T0BMMRv16CRMzysxm6e MX9dnLl/g7V6P+18ePoAbFmm5GcUKDf9D8Ca6s0N1x8fgD0nrVc6hsMzOJbiID2B/xMvm7VL qL0FAAAAAElFTkSuQmCC X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.70.183.196 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:18928 Archived-At: Hello, I receive posts from a Discourse forum as e-mails, but their quote (citation) format has poor readability, so I have written a treatment function that converts such quotes into the usual e-mail citation format. I added this function to `gnus-treatment-function-alist', it is applied to all parts (associated treatment variable set to t) and it works fine. Now, currently this treatment is performed regardless of the provenance of an e-mail, while I'd like it to be performed /iff/ the e-mail is actually from Discourse. >From "Customizing articles" in Gnus' manual, there is no way to set a treatment variable so the treatment applies to /both/ header and body. However, a treatment variable can also be set to a "list where the first element is not a string", and in that case it is interpreted as a predicate. I tried using the `from` predicate as available in `nnmail-split-fancy`, but it isn't recognized. Is there a way to access the headers from a treatment function? -- Damien Collard