From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67092 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: add a gnus-summary-pipe-output-default-command variable Date: Mon, 30 Jun 2008 09:35:20 +0900 Organization: Emacsen advocacy group Message-ID: References: <877ic8krpo.fsf@jidanni.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1214786239 2110 80.91.229.12 (30 Jun 2008 00:37:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Jun 2008 00:37:19 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M15558@lists.math.uh.edu Mon Jun 30 02:38:05 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 1KD7P9-0000CO-D7 for ding-account@gmane.org; Mon, 30 Jun 2008 02:38:03 +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 1KD7NL-00035W-KH; Sun, 29 Jun 2008 19:36:11 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1KD7NK-00035L-CY for ding@lists.math.uh.edu; Sun, 29 Jun 2008 19:36:10 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1KD7NE-0001HD-2d for ding@lists.math.uh.edu; Sun, 29 Jun 2008 19:36:10 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1KD7NW-0007yU-00 for ; Mon, 30 Jun 2008 02:36:22 +0200 Original-Received: from localhost ([127.0.0.1]:48920) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1KD7Mc-00034t-3V for ding@gnus.org; Sun, 29 Jun 2008 19:35:27 -0500 X-Hashcash: 1:20:080630:ding@gnus.org::z/BiKf/SZnRqUOCC:00004ZS4 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:NPEeELMsKwh1ebbYMvR15QRPyd8= 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: -2.4 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67092 Archived-At: --=-=-= >>>>> jidanni@jidanni.org wrote: > gnus-summary-pipe-output needs a > gnus-summary-pipe-output-default-command variable, for users who find > themselves mostly piping to the same command. It should be prompted as > (Default: blabla) in the minibuffer, so one could just hit RET if OK. > (P.S., currently if one does a second pipe, but first removes (DEL > DEL...) the first command replay that one it prompted with, it indeed > still does that same first command again. Kind of scary.) Currently the default command that appears in the minibuffer is the value held by the internal varable `gnus-last-shell-command' when you invoked the `gnus-summary-pipe-output' command or the `gnus-summary-muttprint' command previously. There is the `gnus-summary-muttprint-program' variable as a user option that specifies the default command used by `gnus-summary-muttprint', however it might be unfair that there is no such option for `gnus-summary-pipe-output'. Moreover, the command "muttprint" will be suggested as the default command even if you invoke `gnus-summary-pipe-output' if you've used `gnus-summary-muttprint' previously. The attached patch does: 1. Introduce `gnus-summary-pipe-output-default-command' which overrides `gnus-last-shell-command' if it is non-nil. 2. Make `gnus-summary-muttprint' not modify `gnus-last-shell-command'. `gnus-summary-muttprint-program' itself holds the modified value. A non-nil value of `gnus-summary-pipe-output-default-command' always overrides `gnus-last-shell-command'. So, my worry is that one might forget having set it. WDYT? I'll commit the changes if no one comments. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- gnus-art.el~ 2008-06-11 21:40:58 +0000 +++ gnus-art.el 2008-06-30 00:33:21 +0000 @@ -3968,7 +3968,9 @@ (setq command (read-string "Print using command: " gnus-summary-muttprint-program nil gnus-summary-muttprint-program)) - (gnus-summary-save-in-pipe command)) + (let ((gnus-last-shell-command gnus-last-shell-command)) + (gnus-summary-save-in-pipe command) + (setq gnus-summary-muttprint-program gnus-last-shell-command))) ;;; Article file names when saving. --- gnus-sum.el~ 2008-06-15 21:39:57 +0000 +++ gnus-sum.el 2008-06-30 00:33:21 +0000 @@ -1242,6 +1242,13 @@ :group 'gnus-summary :type '(choice boolean regexp)) +(defcustom gnus-summary-pipe-output-default-command nil + "Command (and optional arguments) used by `gnus-summary-pipe-output'. +The value will be used as the default command if it is non-nil." + :version "23.1" ;; No Gnus + :group 'gnus-summary + :type '(radio (const :tag "None" nil) (string :tag "Command"))) + (defcustom gnus-summary-muttprint-program "muttprint" "Command (and optional arguments) used to run Muttprint." :version "22.1" @@ -11612,7 +11619,9 @@ (interactive (gnus-interactive "P\ny")) (require 'gnus-art) (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe) - (gnus-save-all-headers (or headers gnus-save-all-headers))) + (gnus-save-all-headers (or headers gnus-save-all-headers)) + (gnus-last-shell-command (or gnus-summary-pipe-output-default-command + gnus-last-shell-command))) (gnus-summary-save-article arg t)) (let ((buffer (get-buffer "*Shell Command Output*"))) (when (and buffer --=-=-=--