From 6df73ca3929f58b55a44c87b4a50771eb0b8057d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 17 Aug 2003 00:19:18 +0000 Subject: [PATCH] (ange-ftp-error): Add save-excursion. --- lisp/net/ange-ftp.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index a315482fd1e..c7d0ad2d4a9 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1469,14 +1469,15 @@ only return the directory part of FILE." ;; Display the last chunk of output from the ftp process for the given HOST ;; USER pair, and signal an error including MSG in the text. (defun ange-ftp-error (host user msg) - (let ((cur (selected-window)) - (pop-up-windows t)) - (pop-to-buffer - (get-buffer-create - (ange-ftp-ftp-process-buffer host user))) - (goto-char (point-max)) - (select-window cur)) - (signal 'ftp-error (list (format "FTP Error: %s" msg)))) + (save-excursion ;; Prevent pop-to-buffer from changing current buffer. + (let ((cur (selected-window)) + (pop-up-windows t)) + (pop-to-buffer + (get-buffer-create + (ange-ftp-ftp-process-buffer host user))) + (goto-char (point-max)) + (select-window cur)) + (signal 'ftp-error (list (format "FTP Error: %s" msg))))) (defun ange-ftp-set-buffer-mode () "Set correct modes for the current buffer if visiting a remote file." -- 2.39.2