(mail-source-call-script): Message the error
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 23 Apr 2006 14:09:14 +0000 (14:09 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 23 Apr 2006 14:09:14 +0000 (14:09 +0000)
string.

lisp/ChangeLog
lisp/mail-source.el

index 139a07e..866f702 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * mail-source.el (mail-source-call-script): Message the error
+       string. 
+
 2006-04-22  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-util.el (gnus-byte-compile): Use it.
index d442627..911caef 100644 (file)
@@ -678,12 +678,20 @@ If CONFIRM is non-nil, ask for confirmation before removing a file."
     (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 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