Mercurial > emacs
changeset 70241:07c1b5999e53
(url-open-stream): Don't hide errors.
(url-gateway-nslookup-host, url-open-telnet): Use with-current-buffer.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 26 Apr 2006 20:40:18 +0000 |
parents | 00c538418054 |
children | 90c1af0130a2 |
files | lisp/url/ChangeLog lisp/url/url-gw.el |
diffstat | 2 files changed, 17 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/url/ChangeLog Wed Apr 26 20:37:58 2006 +0000 +++ b/lisp/url/ChangeLog Wed Apr 26 20:40:18 2006 +0000 @@ -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.
--- a/lisp/url/url-gw.el Wed Apr 26 20:37:58 2006 +0000 +++ b/lisp/url/url-gw.el Wed Apr 26 20:40:18 2006 +0000 @@ -118,8 +118,7 @@ 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 @@ (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 @@ (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