diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-06-18 17:00:03 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-06-18 17:00:03 +0000 |
commit | e5f9efd8a28bc78eb82a8145fab596d73ffc09a0 (patch) | |
tree | ba19a8628e35101d9523d1babb33a890b1503040 | |
parent | 4b1383c8155833e3cc3357b1bbc0d85a3bb73824 (diff) | |
download | emacs-e5f9efd8a28bc78eb82a8145fab596d73ffc09a0.tar.gz |
(ange-ftp-kill-ftp-process): Really use the BUFFER arg. Make it optional.
-rw-r--r-- | lisp/ange-ftp.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el index 2329cbf24e8..634726892e1 100644 --- a/lisp/ange-ftp.el +++ b/lisp/ange-ftp.el @@ -1361,14 +1361,15 @@ Optional DEFAULT is password to start with." (ange-ftp-ftp-name buffer-file-name)) (auto-save-mode ange-ftp-auto-save))) -(defun ange-ftp-kill-ftp-process (buffer) - "Kill the FTP process associated with BUFFER. +(defun ange-ftp-kill-ftp-process (&optional buffer) + "Kill the FTP process associated with BUFFER (the current buffer, if nil). If the BUFFER's visited filename or default-directory is an ftp filename then kill the related ftp process." (interactive "bKill FTP process associated with buffer: ") (if (null buffer) (setq buffer (current-buffer))) - (let ((file (or (buffer-file-name) default-directory))) + (let ((file (or (buffer-file-name buffer) + (save-excursion (set-buffer buffer) default-directory)))) (if file (let ((parsed (ange-ftp-ftp-name (expand-file-name file)))) (if parsed |