]> git.eshelyaron.com Git - emacs.git/commitdiff
(url-open-stream): Don't hide errors.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 26 Apr 2006 20:40:18 +0000 (20:40 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 26 Apr 2006 20:40:18 +0000 (20:40 +0000)
(url-gateway-nslookup-host, url-open-telnet): Use with-current-buffer.

lisp/url/ChangeLog
lisp/url/url-gw.el

index 7d9e289e8e57832c3313096ca55dbda5d88f3105..92bdf480e060b5ab9c9a5eaa8380ef563f2197eb 100644 (file)
@@ -1,3 +1,11 @@
+2006-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * url-gw.el (url-open-stream): Don't hide errors.
+       (url-gateway-nslookup-host, url-open-telnet): Use with-current-buffer.
+
+       * url-handlers.el (url-insert): New function.
+       (url-insert-file-contents): Use it.
+
 2006-03-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * url-handlers.el (url-handler-directory-file-name): New handler.
index 0cd2e6f9a50925451d3e6c3bd5d73dc2e43fdd7c..878259927eb7ed5de93e4fbd160eb3d859e9ddc7 100644 (file)
@@ -118,8 +118,7 @@ linked Emacs under SunOS 4.x"
                                 url-gateway-nslookup-program host))
            (res host))
        (set-process-query-on-exit-flag proc nil)
-       (save-excursion
-         (set-buffer (process-buffer proc))
+       (with-current-buffer (process-buffer proc)
          (while (memq (process-status proc) '(run open))
            (accept-process-output proc))
          (goto-char (point-min))
@@ -168,8 +167,7 @@ linked Emacs under SunOS 4.x"
 (defun url-open-telnet (name buffer host service)
   (if (not (stringp service))
       (setq service (int-to-string service)))
-  (save-excursion
-    (set-buffer (get-buffer-create buffer))
+  (with-current-buffer (get-buffer-create buffer)
     (erase-buffer)
     (let ((proc (start-process name buffer "telnet" "-8"))
          (case-fold-search t))
@@ -261,11 +259,15 @@ Will not make a connection if `url-gateway-unplugged' is non-nil."
                         (otherwise
                          (error "Bad setting of url-gateway-method: %s"
                                 url-gateway-method)))))
-       (error
-        (setq conn nil)))
+        ;; Ignoring errors here seems wrong.  E.g. it'll throw away the
+        ;; error signalled two lines above.  It was also found inconvenient
+        ;; during debugging.
+       ;; (error
+       ;;  (setq conn nil))
+       )
       conn)))
 
 (provide 'url-gw)
 
-;;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838
+;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838
 ;;; url-gw.el ends here