changeset 17739:1b0a4e406ba2

(ange-ftp-start-process): Create the buffer and set its mode, before starting the process. Set point in that buffer, and the process mark, (ange-ftp-gwp-start): Don't set the mode here. Move point to end of buffer. (internal-ange-ftp-mode): Don't move process-mark here.
author Richard M. Stallman <rms@gnu.org>
date Sat, 10 May 1997 22:29:42 +0000
parents f20c2a909ad3
children edebe056f7bc
files lisp/ange-ftp.el
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ange-ftp.el	Sat May 10 21:48:30 1997 +0000
+++ b/lisp/ange-ftp.el	Sat May 10 22:29:42 1997 +0000
@@ -1683,7 +1683,7 @@
     (set-process-filter proc (function ange-ftp-gwp-filter))
     (save-excursion
       (set-buffer (process-buffer proc))
-      (internal-ange-ftp-mode)
+      (goto-char (point-max))
       (set-marker (process-mark proc) (point)))
     (setq ange-ftp-gwp-running t
 	  ange-ftp-gwp-status nil)
@@ -1827,7 +1827,11 @@
     ;; but that doesn't work: ftp never responds.
     ;; Can anyone find a fix for that?
     (let ((process-connection-type t)
-	  (process-environment process-environment))
+	  (process-environment process-environment)
+	  (buffer (get-buffer-create name)))
+      (save-excursion
+	(set-buffer buffer)
+	(internal-ange-ftp-mode))
       ;; This tells GNU ftp not to output any fancy escape sequences.
       (setenv "TERM" "dumb")
       (if use-gateway
@@ -1838,10 +1842,11 @@
 					    ange-ftp-gateway-host)
 				      args))))
 	(setq proc (apply 'start-process name name args))))
-    (process-kill-without-query proc)
     (save-excursion
       (set-buffer (process-buffer proc))
-      (internal-ange-ftp-mode))
+      (goto-char (point-max))
+      (set-marker (process-mark proc) (point)))
+    (process-kill-without-query proc)
     (set-process-sentinel proc (function ange-ftp-process-sentinel))
     (set-process-filter proc (function ange-ftp-process-filter))
     (accept-process-output proc)	;wait for ftp startup message
@@ -1858,8 +1863,6 @@
   (setq major-mode 'internal-ange-ftp-mode)
   (setq mode-name "Internal Ange-ftp")
   (let ((proc (get-buffer-process (current-buffer))))
-    (goto-char (point-max))
-    (set-marker (process-mark proc) (point))
     (make-local-variable 'ange-ftp-process-string)
     (setq ange-ftp-process-string "")
     (make-local-variable 'ange-ftp-process-busy)