From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67180 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-summary-save-in-pipe does not pipe raw article Date: Fri, 25 Jul 2008 09:15:45 +0900 Organization: Emacsen advocacy group Message-ID: References: <87mykes2g8.fsf@newton.gmurray.org.uk> <87d4l3miah.fsf@uwo.ca> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1216945066 18219 80.91.229.12 (25 Jul 2008 00:17:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jul 2008 00:17:46 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M15639@lists.math.uh.edu Fri Jul 25 02:18:35 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1KMB0z-0007JL-Vg for ding-account@gmane.org; Fri, 25 Jul 2008 02:18:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1KMAz2-0007dG-Oo; Thu, 24 Jul 2008 19:16:32 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1KMAz1-0007d1-0S for ding@lists.math.uh.edu; Thu, 24 Jul 2008 19:16:31 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1KMAyx-0002ru-2a for ding@lists.math.uh.edu; Thu, 24 Jul 2008 19:16:30 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1KMAzI-0002TH-00 for ; Fri, 25 Jul 2008 02:16:48 +0200 Original-Received: from localhost ([127.0.0.1]:60145) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1KMAyK-0007tG-6s for ding@gnus.org; Thu, 24 Jul 2008 19:15:48 -0500 X-Hashcash: 1:20:080725:ding@gnus.org::54j0218V+gsS/RKk:00002W+E X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:xYjGqg3sbnRiUunCFYlc2pd8HVs= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67180 Archived-At: --=-=-= >>>>> Dan Christensen wrote: > Katsumi Yamaoka writes: >> (let* ((pipe (format "cat | /path/to/cmd")) >> >> (decode (get 'gnus-summary-save-in-pipe :decode)) >> (headers (get 'gnus-summary-save-in-pipe :headers)) >> (gnus-save-all-headers t) >> >> ) >> (put 'gnus-summary-save-in-pipe :decode nil) >> (put 'gnus-summary-save-in-pipe :headers nil) >> (unwind-protect >> (save-excursion >> (dolist (article (gnus-summary-work-articles n)) >> (gnus-summary-goto-subject article) >> (gnus-summary-save-in-pipe pipe) >> )) >> (put 'gnus-summary-save-in-pipe :decode decode) >> (put 'gnus-summary-save-in-pipe :headers headers))) >> (gnus-summary-expand-window)) > Maybe all but two or three lines of the above should be made into a > function gnus-summary-save-in-pipe-raw? Or maybe the existing function > gnus-summary-save-in-pipe should take an optional "raw" argument to get > this behaviour? Forcing the caller to jump through the above hoops > seems excessive... That's good. Thanks. I've added to `gnus-summary-save-in-pipe' the optional 2nd argument `raw' meaning: ,---- | Non-nil value for RAW overrides `:decode' and `:headers' properties | and the raw article including all headers will be piped. `---- So, now Gabor's function can be simplified into: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (defun gzp-pipe-spam (&optional n) (interactive "P") (let ((pipe (format "cat | /path/to/cmd"))) (save-excursion (dolist (article (gnus-summary-work-articles n)) (gnus-summary-goto-subject article) (gnus-summary-save-in-pipe pipe t)))) (gnus-summary-expand-window)) --=-=-=--