diff options
| author | Richard M. Stallman | 1996-03-27 00:10:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-03-27 00:10:38 +0000 |
| commit | 730cdbb27ec6f299783d278975501c1287709d9e (patch) | |
| tree | cdf144bcf1966ede188675b431af5c2cff66c0d9 | |
| parent | 8d31ff153a5cbf842b3a5404e2d62c3967194744 (diff) | |
| download | emacs-730cdbb27ec6f299783d278975501c1287709d9e.tar.gz emacs-730cdbb27ec6f299783d278975501c1287709d9e.zip | |
(ange-ftp-wait-not-busy): New subroutine.
Kill ftp process if user quits.
(ange-ftp-raw-send-cmd): Use that.
(ange-ftp-fix-dir-name-for-cms): Fix error message.
| -rw-r--r-- | lisp/ange-ftp.el | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el index 1da75d4e3e3..2329cbf24e8 100644 --- a/lisp/ange-ftp.el +++ b/lisp/ange-ftp.el | |||
| @@ -1711,16 +1711,7 @@ been queued with no result. CONT will still be called, however." | |||
| 1711 | (if (memq (process-status proc) '(run open)) | 1711 | (if (memq (process-status proc) '(run open)) |
| 1712 | (save-excursion | 1712 | (save-excursion |
| 1713 | (set-buffer (process-buffer proc)) | 1713 | (set-buffer (process-buffer proc)) |
| 1714 | (while ange-ftp-process-busy | 1714 | (ange-ftp-wait-not-busy proc) |
| 1715 | ;; This is a kludge to let user quit in case ftp gets hung. | ||
| 1716 | ;; It matters because this function can be called from the filter. | ||
| 1717 | ;; It is bad to allow quitting in a filter, but getting hung | ||
| 1718 | ;; is worse. By binding quit-flag to nil, we might avoid | ||
| 1719 | ;; most of the probability of getting screwed because the user | ||
| 1720 | ;; wants to quit some command. | ||
| 1721 | (let ((quit-flag nil) | ||
| 1722 | (inhibit-quit nil)) | ||
| 1723 | (accept-process-output))) | ||
| 1724 | (setq ange-ftp-process-string "" | 1715 | (setq ange-ftp-process-string "" |
| 1725 | ange-ftp-process-result-line "" | 1716 | ange-ftp-process-result-line "" |
| 1726 | ange-ftp-process-busy t | 1717 | ange-ftp-process-busy t |
| @@ -1744,17 +1735,33 @@ been queued with no result. CONT will still be called, however." | |||
| 1744 | (set-marker (process-mark proc) (point)) | 1735 | (set-marker (process-mark proc) (point)) |
| 1745 | (if nowait | 1736 | (if nowait |
| 1746 | nil | 1737 | nil |
| 1747 | ;; hang around for command to complete | 1738 | (ange-ftp-wait-not-busy proc) |
| 1748 | (while ange-ftp-process-busy | ||
| 1749 | ;; This is a kludge to let user quit in case ftp gets hung. | ||
| 1750 | ;; It matters because this function can be called from the filter. | ||
| 1751 | (let ((quit-flag nil) | ||
| 1752 | (inhibit-quit nil)) | ||
| 1753 | (accept-process-output proc))) | ||
| 1754 | (if cont | 1739 | (if cont |
| 1755 | nil ;cont has already been called | 1740 | nil ;cont has already been called |
| 1756 | (cons ange-ftp-process-result ange-ftp-process-result-line)))))) | 1741 | (cons ange-ftp-process-result ange-ftp-process-result-line)))))) |
| 1757 | 1742 | ||
| 1743 | ;; Wait for the ange-ftp process PROC not to be busy. | ||
| 1744 | (defun ange-ftp-wait-not-busy (proc) | ||
| 1745 | (save-excursion | ||
| 1746 | (set-buffer (process-buffer proc)) | ||
| 1747 | (condition-case nil | ||
| 1748 | ;; This is a kludge to let user quit in case ftp gets hung. | ||
| 1749 | ;; It matters because this function can be called from the filter. | ||
| 1750 | ;; It is bad to allow quitting in a filter, but getting hung | ||
| 1751 | ;; is worse. By binding quit-flag to nil, we might avoid | ||
| 1752 | ;; most of the probability of getting screwed because the user | ||
| 1753 | ;; wants to quit some command. | ||
| 1754 | (let ((quit-flag nil) | ||
| 1755 | (inhibit-quit nil)) | ||
| 1756 | (while ange-ftp-process-busy | ||
| 1757 | (accept-process-output proc))) | ||
| 1758 | (quit | ||
| 1759 | ;; If the user does quit out of this, | ||
| 1760 | ;; kill the process. That stops any transfer in progress. | ||
| 1761 | ;; The next operation will open a new ftp connection. | ||
| 1762 | (delete-process proc) | ||
| 1763 | (signal 'quit nil))))) | ||
| 1764 | |||
| 1758 | (defun ange-ftp-nslookup-host (host) | 1765 | (defun ange-ftp-nslookup-host (host) |
| 1759 | "Attempt to resolve the given HOSTNAME using nslookup if possible." | 1766 | "Attempt to resolve the given HOSTNAME using nslookup if possible." |
| 1760 | (interactive "sHost: ") | 1767 | (interactive "sHost: ") |
| @@ -5281,7 +5288,7 @@ Other orders of $ and _ seem to all work just fine.") | |||
| 5281 | file | 5288 | file |
| 5282 | ;; give up | 5289 | ;; give up |
| 5283 | (ange-ftp-error ange-ftp-this-host ange-ftp-this-user | 5290 | (ange-ftp-error ange-ftp-this-host ange-ftp-this-user |
| 5284 | (format "cd to minidisk %s failed: " | 5291 | (format "cd to minidisk %s failed: %s" |
| 5285 | minidisk (cdr result)))))))) | 5292 | minidisk (cdr result)))))))) |
| 5286 | (t (error "Invalid CMS file name")))) | 5293 | (t (error "Invalid CMS file name")))) |
| 5287 | 5294 | ||