]> git.eshelyaron.com Git - emacs.git/commitdiff
(ange-ftp-error): Add save-excursion.
authorRichard M. Stallman <rms@gnu.org>
Sun, 17 Aug 2003 00:19:18 +0000 (00:19 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 17 Aug 2003 00:19:18 +0000 (00:19 +0000)
lisp/net/ange-ftp.el

index a315482fd1eaaff242fcb6da0d45c50519425321..c7d0ad2d4a967084bf7e5d536cca607d7bed9e1a 100644 (file)
@@ -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."