erbot-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erbot-cvs] Changes to erbot/erbc.el


From: Pete Kazmier
Subject: [Erbot-cvs] Changes to erbot/erbc.el
Date: Sun, 23 Jan 2005 00:14:33 -0500

Index: erbot/erbc.el
diff -u erbot/erbc.el:1.83 erbot/erbc.el:1.84
--- erbot/erbc.el:1.83  Sun Jan  9 01:10:42 2005
+++ erbot/erbc.el       Sun Jan 23 05:14:33 2005
@@ -4159,18 +4159,22 @@
 
 (defalias 'fsi-shell-test 'erbn-shell-test)
 
+(defcustom fs-internal-web-page-time 10
+  "" :group 'erbc)
+
 (defmacro erbn-with-web-page-buffer (site &rest body)
   (let ((buffer (make-symbol "web-buffer")))
-    `(let ((,buffer (url-retrieve-synchronously ,site)))
-       (when (null ,buffer)
-         (error "Invalid URL %s" site))
-       (save-excursion
-         (set-buffer ,buffer)
-         (goto-char (point-min))
-         (prog1
-             (progn
-               ,@body)
-           (kill-buffer ,buffer))))))
+    `(with-timeout (fs-internal-web-page-time "HTTP time out")
+       (let ((,buffer (url-retrieve-synchronously ,site)))
+         (when (null ,buffer)
+           (error "Invalid URL %s" site))
+         (save-excursion
+           (set-buffer ,buffer)
+           (goto-char (point-min))
+           (prog1
+               (progn
+                 ,@body)
+             (kill-buffer ,buffer)))))))
 
 (defun fsi-web-page-title (&optional site &rest args)
   (unless site (error (format "Syntax: %s web-page-title SITE" erbn-char)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]