From: Timo Lilja <timo.lilja@hut.fi>
Subject: Re: Script output in mail-source directory :prescript
Date: Wed, 26 Apr 2006 08:56:04 +0300 [thread overview]
Message-ID: <87hd4gribv.fsf@frog.cs.hut.fi> (raw)
In-Reply-To: <m3mzecfknu.fsf@quimbies.gnus.org>
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>Timo Lilja <timo.lilja@hut.fi> writes:
>
>> 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.
>
>Try the following patch:
[...]
Nope, It didn't work for me but I modified it a bit and now it works:
--- orig.mail-source.el 2005-03-18 06:35:29.000000000 +0200
+++ mail-source.el 2006-04-26 08:48:59.000000000 +0300
@@ -667,12 +667,23 @@
(sleep-for delay)))
(defun mail-source-call-script (script)
- (let ((background nil))
+ (let ((background nil)
+ (stderr (get-buffer-create " *mail-source-stderr*"))
+ result)
(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)))
+ (setq result
+ (call-process shell-file-name nil stderr nil
+ shell-command-switch script))
+ (if (and result
+ (not (zerop result)))
+ (progn
+ (split-window-vertically)
+ (other-window 1)
+ (switch-to-buffer stderr)
+ (message "Mail source error: %s" (buffer-string)))
+ (kill-buffer stderr))))
;;;
;;; Different fetchers
>
>Index: mail-source.el
>===================================================================
>RCS file: /usr/local/cvsroot/gnus/lisp/mail-source.el,v
>retrieving revision 7.15
>retrieving revision 7.16
>diff -c -r7.15 -r7.16
>*** mail-source.el 8 Feb 2006 04:17:15 -0000 7.15
>--- mail-source.el 23 Apr 2006 14:09:14 -0000 7.16
>***************
>*** 678,689 ****
> (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)))
>
> ;;;
> ;;; Different fetchers
>--- 678,697 ----
> (sleep-for delay)))
>
> (defun mail-source-call-script (script)
>! (let ((background nil)
>! (stderr (get-buffer-create " *mail-source-stderr*"))
>! result)
> (when (string-match "& *$" script)
> (setq script (substring script 0 (match-beginning 0))
> background 0))
>! (setq result
>! (call-process shell-file-name nil background nil
>! shell-command-switch script))
>! (when (and result
>! (not (zerop result)))
>! (set-buffer stderr)
>! (message "Mail source error: %s" (buffer-string)))
>! (kill-buffer stderr)))
>
> ;;;
> ;;; Different fetchers
>
>--
>(domestic pets only, the antidote for overdose, milk.)
> larsi@gnus.org * Lars Magne Ingebrigtsen
--
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."
next prev parent reply other threads:[~2006-04-26 5:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-18 21:20 Timo Lilja
2006-04-23 14:09 ` Lars Magne Ingebrigtsen
2006-04-26 5:56 ` Timo Lilja [this message]
2006-04-30 10:51 ` Lars Magne Ingebrigtsen
2006-05-13 17:04 ` Timo Lilja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hd4gribv.fsf@frog.cs.hut.fi \
--to=timo.lilja@hut.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).