From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87344 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: writing a function that pipes the html mime part to an external script Date: Fri, 20 Jan 2017 12:34:59 -0800 Message-ID: <87inp9zczw.fsf@ericabrahamsen.net> References: <877f5qi5df.fsf@b79.net> <87efzy9fnw.fsf@linux-m68k.org> <87r33xhgic.fsf@b79.net> <87vat9zjtv.fsf@ericabrahamsen.net> <87o9z1fqfw.fsf@b79.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1484944560 1233 195.159.176.226 (20 Jan 2017 20:36:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 20 Jan 2017 20:36:00 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+M35564@lists.math.uh.edu Fri Jan 20 21:35:51 2017 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUfuT-0007ix-RX for ding-account@gmane.org; Fri, 20 Jan 2017 21:35:46 +0100 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 1cUfuD-0008Dc-7t; Fri, 20 Jan 2017 14:35:29 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1cUfuA-0008Cu-Ez for ding@lists.math.uh.edu; Fri, 20 Jan 2017 14:35:26 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1cUfu9-00015h-Bo for ding@lists.math.uh.edu; Fri, 20 Jan 2017 14:35:26 -0600 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 1cUfu7-0003cG-9w for ding@gnus.org; Fri, 20 Jan 2017 21:35:23 +0100 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cUftn-0004Pz-GT for ding@gnus.org; Fri, 20 Jan 2017 21:35:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:iIWcoMvwlQLjESY39nM/Q9KyTmo= List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87344 Archived-At: John Magolske writes: > Eric Abrahamsen writes: >> John Magolske writes: >>> Andreas Schwab writes: >>> >>>> Write a function that calls mm-pipe-part directly. >>> >>> This is where I'm stuck... I believe there should be something like >>> >>> (mm-pipe-part HANDLE "~/bin/pipe_to_tmp") >>> >>> in the function, but I can't figure out exactly what should go in the >>> place of HANDLE here. >> >> You can get the various article part handles with >> `gnus-article-mime-handles', is that what you were looking for? > > I just tried that in an article buffer, got this: > > ((1 # ("text/html" (charset . "UTF-8")) > quoted-printable nil nil nil nil nil)) > > and am wondering which part of that is HANDLE ... > > I tried: > > Eval: (mm-pipe-part "text/html" "~/bin/pipe_to_tmp") > (wrong-type-argument listp "text/html") in eval > > Eval: (mm-pipe-part ("text/html" (charset . "UTF-8")) "~/bin/pipe_to_tmp") > (invalid-function "text/html") in mm-pipe-part I believe the car of the result (ie the "1") is the handle, though I'm a bit at sea with this code. I think what you'll need to do is loop through the handles and see which one is "text/html", and then pass the handle (the number) to `mm-pipe-part'. Like I said, though, I really don't have much experience with this code, so hopefully someone else will confirm/deny. Eric