diff Misc/python-mode.el @ 2796:ebc1714dc738 legacy-trunk

(py-process-filter): if command takes a long time, input typed before the next prompt could end up in the middle of the line, instead of after it. Fix given by klm@nist.gov.
author Barry Warsaw <barry@python.org>
date Wed, 05 Jul 1995 22:27:23 +0000
parents ea38c363de58
children 7f2c0e7ef842
line wrap: on
line diff
--- a/Misc/python-mode.el	Wed Jul 05 22:06:50 1995 +0000
+++ b/Misc/python-mode.el	Wed Jul 05 22:27:23 1995 +0000
@@ -654,6 +654,7 @@
     (set-buffer pbuf)
     (let* ((start (point))
 	   (goback (< start pmark))
+	   (goend (and (not goback) (= start (point-max))))
 	   (buffer-read-only nil))
       (goto-char pmark)
       (insert string)
@@ -670,14 +671,18 @@
 	(if py-scroll-process-buffer
 	    (let* ((pop-up-windows t)
 		   (pwin (display-buffer pbuf)))
-	      (set-window-point pwin (point))))))
-    (set-buffer curbuf)
-    (if file-finished
-	(progn
-	  (py-delete-file-silently (car py-file-queue))
-	  (setq py-file-queue (cdr py-file-queue))
-	  (if py-file-queue
-		(py-execute-file pyproc (car py-file-queue)))))))
+	      (set-window-point pwin (point)))))
+      (set-buffer curbuf)
+      (if file-finished
+	  (progn
+	    (py-delete-file-silently (car py-file-queue))
+	    (setq py-file-queue (cdr py-file-queue))
+	    (if py-file-queue
+		(py-execute-file pyproc (car py-file-queue)))))
+      (and goend
+	   (progn (set-buffer pbuf)
+		  (goto-char (point-max))))
+      )))
 
 (defun py-execute-buffer ()
   "Send the contents of the buffer to a Python interpreter.