From: Richard M. Stallman Date: Tue, 18 Jun 1996 17:00:03 +0000 (+0000) Subject: (ange-ftp-kill-ftp-process): Really use the BUFFER arg. Make it optional. X-Git-Tag: emacs-19.34~413 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c360b9251bb7e0979839433d283f2197852fa94d;p=emacs.git (ange-ftp-kill-ftp-process): Really use the BUFFER arg. Make it optional. --- 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