X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmail-source.el;h=5cf40161c591e21ea88a12a46ced4f9e04de580e;hb=9b741e050b400987d68ff761c6cc3276c932839c;hp=3409021ae6a92d20a0d1577af35f636a1cb2f917;hpb=546e9828be8e39aa275a4e2c53c217e86ae8f122;p=elisp%2Fgnus.git- diff --git a/lisp/mail-source.el b/lisp/mail-source.el index 3409021..5cf4016 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -466,17 +466,21 @@ Return the number of files that were found." (funcall function source callback) (error (unless (yes-or-no-p - (format "Mail source error (%s). Continue? " err)) + (format "Mail source error (%s). Continue? " + (cadr err))) (error "Cannot get new mail")) 0))))))))) -(defun mail-source-make-complex-temp-name (prefix) - (let ((newname (make-temp-name prefix)) - (newprefix prefix)) - (while (file-exists-p newname) - (setq newprefix (concat newprefix "x")) - (setq newname (make-temp-name newprefix))) - newname)) +(eval-and-compile + (if (fboundp 'make-temp-file) + (defalias 'mail-source-make-complex-temp-name 'make-temp-file) + (defun mail-source-make-complex-temp-name (prefix) + (let ((newname (make-temp-name prefix)) + (newprefix prefix)) + (while (file-exists-p newname) + (setq newprefix (concat newprefix "x")) + (setq newname (make-temp-name newprefix))) + newname)))) (defun mail-source-callback (callback info) "Call CALLBACK on the mail file, and then remove the mail file.