From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/40870 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Support for Muttprint Date: Sun, 16 Dec 2001 19:01:55 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035176356 3203 80.91.224.250 (21 Oct 2002 04:59:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:59:16 +0000 (UTC) Return-Path: Original-Received: (qmail 7915 invoked from network); 16 Dec 2001 18:04:03 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 16 Dec 2001 18:04:03 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16FfdR-0007vA-00; Sun, 16 Dec 2001 12:03:37 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 16 Dec 2001 12:03:26 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id MAA27145 for ; Sun, 16 Dec 2001 12:03:15 -0600 (CST) Original-Received: (qmail 7897 invoked by alias); 16 Dec 2001 18:03:21 -0000 Original-Received: (qmail 7892 invoked from network); 16 Dec 2001 18:03:21 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by gnus.org with SMTP; 16 Dec 2001 18:03:21 -0000 Original-Received: from dhcp128.extundo.com ([195.42.214.241]) (authenticated bits=0) by yxa.extundo.com (8.12.1/8.12.1) with ESMTP id fBGI3V3O000749 for ; Sun, 16 Dec 2001 19:03:31 +0100 Original-To: ding@gnus.org Original-Lines: 114 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.50 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:40870 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:40870 I've committed the below, to support Muttprint. Install Muttprint from http://muttprint.sourceforge.net/ and print using it with `O P'. 2001-12-16 Simon Josefsson Inspired by code by Bernhard Walle . * gnus-sum.el (gnus-summary-muttprint-program): New variable. (gnus-summary-save-map): Add muttprint. (gnus-summary-make-menu-bar): Ditto. (gnus-summary-muttprint): New function. * gnus-art.el (gnus-summary-pipe-to-muttprint): New function. 2001-12-16 Simon Josefsson * gnus.texi (Saving Articles): Add muttprint. (Article Commands): Mention muttprint. --- gnus-sum.el.~6.130.~ Wed Dec 12 17:56:38 2001 +++ gnus-sum.el Sun Dec 16 18:43:02 2001 @@ -998,6 +998,11 @@ :group 'gnus-summary :type '(choice boolean regexp)) +(defcustom gnus-summary-muttprint-program "muttprint" + "Command (and optional arguments) used to run Muttprint." + :group 'gnus-summary + :type 'string) + ;;; Internal variables (defvar gnus-summary-display-cache nil) @@ -1801,6 +1806,7 @@ "h" gnus-summary-save-article-folder "v" gnus-summary-save-article-vm "p" gnus-summary-pipe-output + "P" gnus-summary-muttprint "s" gnus-soup-add-article) (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map) @@ -1929,6 +1935,7 @@ ["Save body in file" gnus-summary-save-article-body-file t] ["Pipe through a filter" gnus-summary-pipe-output t] ["Add to SOUP packet" gnus-soup-add-article t] + ["Print with Muttprint" gnus-summary-muttprint t] ["Print" gnus-summary-print-article t]) ("Backend" ["Respool article..." gnus-summary-respool-article t] @@ -9946,6 +9953,17 @@ (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file)) (gnus-summary-save-article arg))) +(defun gnus-summary-muttprint (&optional arg) + "Print the current article using Muttprint. +If N is a positive number, save the N next articles. +If N is a negative number, save the N previous articles. +If N is nil and any articles have been marked with the process mark, +save those articles instead." + (interactive "P") + (require 'gnus-art) + (let ((gnus-default-article-saver 'gnus-summary-pipe-to-muttprint)) + (gnus-summary-save-article arg t))) + (defun gnus-summary-pipe-message (program) "Pipe the current article through PROGRAM." (interactive "sProgram: ") --- gnus-art.el.~6.122.~ Wed Dec 12 17:40:52 2001 +++ gnus-art.el Sun Dec 16 18:47:09 2001 @@ -2763,6 +2763,13 @@ (shell-command-on-region (point-min) (point-max) command nil))) (setq gnus-last-shell-command command)) +(defun gnus-summary-pipe-to-muttprint (&optional command) + "Pipe this article to muttprint." + (setq command (read-string + "Print using command: " gnus-summary-muttprint-program + nil gnus-summary-muttprint-program)) + (gnus-summary-save-in-pipe command)) + ;;; Article file names when saving. (defun gnus-capitalize-newsgroup (newsgroup) --- gnus.texi.~6.195.~ Sat Dec 15 18:23:12 2001 +++ gnus.texi Sun Dec 16 18:58:55 2001 @@ -6932,6 +6932,17 @@ @findex gnus-summary-pipe-output Save the current article in a pipe. Uhm, like, what I mean is---Pipe the current article to a process (@code{gnus-summary-pipe-output}). + +@item O P +@kindex O P (Summary) +@findex gnus-summary-muttprint +@vindex gnus-summary-muttprint-program +Save the current article into muttprint. That is, print it using the +external program Muttprint (see +@uref{http://muttprint.sourceforge.net/}). The program name and +options to use is controlled by the variable +@code{gnus-summary-muttprint-program}. (@code{gnus-summary-muttprint}). + @end table @vindex gnus-prompt-before-saving @@ -8702,8 +8713,9 @@ @vindex gnus-ps-print-hook @findex gnus-summary-print-article Generate and print a PostScript image of the article buffer -(@code{gnus-summary-print-article}). @code{gnus-ps-print-hook} will be -run just before printing the buffer. +(@code{gnus-summary-print-article}). @code{gnus-ps-print-hook} will +be run just before printing the buffer. An alternative way to print +article is to use Muttprint (@pxref{Saving Articles}). @end table