From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/7111 Path: news.gmane.org!not-for-mail From: Timo Lilja Newsgroups: gmane.emacs.gnus.user Subject: Script output in mail-source directory :prescript Date: Wed, 19 Apr 2006 00:20:22 +0300 Organization: Helsinki University of Technology, CS lab Message-ID: <87mzei1vey.fsf@frog.cs.hut.fi> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145410935 28222 80.91.229.2 (19 Apr 2006 01:42:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Apr 2006 01:42:15 +0000 (UTC) Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Wed Apr 19 03:42:13 2006 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FW1ha-0005uf-43 for gegu-info-gnus-english@m.gmane.org; Wed, 19 Apr 2006 03:41:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FW1hZ-0001dr-LQ for gegu-info-gnus-english@m.gmane.org; Tue, 18 Apr 2006 21:41:53 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!newsfeed1.funet.fi!newsfeed3.funet.fi!newsfeeds.funet.fi!news.cs.hut.fi!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 46 Original-NNTP-Posting-Host: frog.cs.hut.fi Original-X-Trace: midnight.cs.hut.fi 1145395258 67119768 130.233.192.113 (18 Apr 2006 21:20:58 GMT) Original-X-Complaints-To: abuse@niksula.cs.hut.fi Original-NNTP-Posting-Date: 18 Apr 2006 21:20:58 GMT User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:qsl/v6yPx9aX86CVtIypP3CDCvw= Original-Xref: shelby.stanford.edu gnu.emacs.gnus:77293 Original-To: info-gnus-english@gnu.org X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 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: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:7111 Archived-At: Is there a way to get the script output and some kind of a notice if the exit status of the script is non-zero in a directory mail source :prescript? I have the following in ~/.gnus: (setq mail-sources '((directory :path "~/path/to/mail-in" :prescript "~/path/to/get-mail-script"))) Now, the problem is that if the get-mail-script has a non-zero exit or produces some output, nothing is shown in the Emacs buffers. The following patch almost does what I have in mind: --- orig.mail-source.el 2005-03-18 06:35:29.000000000 +0200 +++ mail-source.el 2006-04-19 00:09:56.000000000 +0300 @@ -667,12 +667,9 @@ (sleep-for delay))) (defun mail-source-call-script (script) - (let ((background nil)) - (when (string-match "& *$" script) - (setq script (substring script 0 (match-beginning 0)) - background 0)) - (call-process shell-file-name nil background nil - shell-command-switch script))) + (let ((resize-mini-windows nil) + (max-mini-window-height 0)) + (shell-command script))) ;;; ;;; Different fetchers Unfortunately (shell-command) does not pop the output buffer if there is only single line of output. It doesn't help to change the `resize-mini-windows' or `max-mini-window-height' either. If the script exist status is non-zero, (shell-command) produces no output. -- Timo Lilja "It's a 106 miles to Chicago. We've got a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses."