diff options
| author | Stefan Monnier | 2005-06-10 21:14:34 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-06-10 21:14:34 +0000 |
| commit | 7f95457178a15c411cc91d94ddefab6d1e5fa77a (patch) | |
| tree | 234eb40e9fcf6a002405383c75a1314bbdfaf4fa | |
| parent | f1b587064a41ef495ef7a87b992dbdd711d557da (diff) | |
| download | emacs-7f95457178a15c411cc91d94ddefab6d1e5fa77a.tar.gz emacs-7f95457178a15c411cc91d94ddefab6d1e5fa77a.zip | |
(url-retrieve-synchronously): Don't exit precipitously when
fetching a file via ange-ftp.
| -rw-r--r-- | lisp/url/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/url/url.el | 31 |
2 files changed, 28 insertions, 13 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index a8149c2f659..8ec7293a458 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,7 +1,13 @@ | |||
| 1 | 2005-06-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * url-handlers.el (vc-registered): Explicitly disable VC for URL files. | ||
| 4 | |||
| 5 | * url.el (url-retrieve-synchronously): Don't exit precipitously when | ||
| 6 | fetching a file via ange-ftp. | ||
| 7 | |||
| 1 | 2005-06-10 Juanma Barranquero <lekktu@gmail.com> | 8 | 2005-06-10 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 9 | ||
| 3 | * url-cookie.el (url-cookie-multiple-line): Fix spelling in | 10 | * url-cookie.el (url-cookie-multiple-line): Fix spelling in docstring. |
| 4 | docstring. | ||
| 5 | 11 | ||
| 6 | 2005-05-19 Juanma Barranquero <lekktu@gmail.com> | 12 | 2005-05-19 Juanma Barranquero <lekktu@gmail.com> |
| 7 | 13 | ||
diff --git a/lisp/url/url.el b/lisp/url/url.el index 05ef85c9300..8b57d885949 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el | |||
| @@ -170,17 +170,26 @@ no further processing). URL is either a string or a parsed URL." | |||
| 170 | (url-debug 'retrieval "Synchronous fetching done (%S)" (current-buffer)) | 170 | (url-debug 'retrieval "Synchronous fetching done (%S)" (current-buffer)) |
| 171 | (setq retrieval-done t | 171 | (setq retrieval-done t |
| 172 | asynch-buffer (current-buffer))))) | 172 | asynch-buffer (current-buffer))))) |
| 173 | (let ((proc (and asynch-buffer (get-buffer-process asynch-buffer)))) | 173 | (if (null asynch-buffer) |
| 174 | (if (null proc) | 174 | ;; We do not need to do anything, it was a mailto or something |
| 175 | ;; We do not need to do anything, it was a mailto or something | 175 | ;; similar that takes processing completely outside of the URL |
| 176 | ;; similar that takes processing completely outside of the URL | 176 | ;; package. |
| 177 | ;; package. | 177 | nil |
| 178 | nil | 178 | (let ((proc (get-buffer-process asynch-buffer))) |
| 179 | ;; If the access method was synchronous, `retrieval-done' should | ||
| 180 | ;; hopefully already be set to t. If it is nil, and `proc' is also | ||
| 181 | ;; nil, it implies that the async process is not running in | ||
| 182 | ;; asynch-buffer. This happens e.g. for FTP files. In such a case | ||
| 183 | ;; url-file.el should probably set something like a `url-process' | ||
| 184 | ;; buffer-local variable so we can find the exact process that we | ||
| 185 | ;; should be waiting for. In the mean time, we'll just wait for any | ||
| 186 | ;; process output. | ||
| 179 | (while (not retrieval-done) | 187 | (while (not retrieval-done) |
| 180 | (url-debug 'retrieval | 188 | (url-debug 'retrieval |
| 181 | "Spinning in url-retrieve-synchronously: %S (%S)" | 189 | "Spinning in url-retrieve-synchronously: %S (%S)" |
| 182 | retrieval-done asynch-buffer) | 190 | retrieval-done asynch-buffer) |
| 183 | (if (memq (process-status proc) '(closed exit signal failed)) | 191 | (if (and proc (memq (process-status proc) |
| 192 | '(closed exit signal failed))) | ||
| 184 | ;; FIXME: It's not clear whether url-retrieve's callback is | 193 | ;; FIXME: It's not clear whether url-retrieve's callback is |
| 185 | ;; guaranteed to be called or not. It seems that url-http | 194 | ;; guaranteed to be called or not. It seems that url-http |
| 186 | ;; decides sometimes consciously not to call it, so it's not | 195 | ;; decides sometimes consciously not to call it, so it's not |
| @@ -193,7 +202,7 @@ no further processing). URL is either a string or a parsed URL." | |||
| 193 | ;; interrupt it before it got a chance to handle process input. | 202 | ;; interrupt it before it got a chance to handle process input. |
| 194 | ;; `sleep-for' was tried but it lead to other forms of | 203 | ;; `sleep-for' was tried but it lead to other forms of |
| 195 | ;; hanging. --Stef | 204 | ;; hanging. --Stef |
| 196 | (unless (accept-process-output proc) | 205 | (unless (or (accept-process-output proc) (null proc)) |
| 197 | ;; accept-process-output returned nil, maybe because the process | 206 | ;; accept-process-output returned nil, maybe because the process |
| 198 | ;; exited (and may have been replaced with another). | 207 | ;; exited (and may have been replaced with another). |
| 199 | (setq proc (get-buffer-process asynch-buffer)))))) | 208 | (setq proc (get-buffer-process asynch-buffer)))))) |
| @@ -201,9 +210,9 @@ no further processing). URL is either a string or a parsed URL." | |||
| 201 | 210 | ||
| 202 | (defun url-mm-callback (&rest ignored) | 211 | (defun url-mm-callback (&rest ignored) |
| 203 | (let ((handle (mm-dissect-buffer t))) | 212 | (let ((handle (mm-dissect-buffer t))) |
| 204 | (save-excursion | 213 | (url-mark-buffer-as-dead (current-buffer)) |
| 205 | (url-mark-buffer-as-dead (current-buffer)) | 214 | (with-current-buffer |
| 206 | (set-buffer (generate-new-buffer (url-recreate-url url-current-object))) | 215 | (generate-new-buffer (url-recreate-url url-current-object)) |
| 207 | (if (eq (mm-display-part handle) 'external) | 216 | (if (eq (mm-display-part handle) 'external) |
| 208 | (progn | 217 | (progn |
| 209 | (set-process-sentinel | 218 | (set-process-sentinel |