Subject: bug#1344: lisp/progmodes/tcl.el (tcl-filter): shouldn't move point

From: Ivan Shmakov <[email-masked]>
Date: Tue, 04 Nov 2008 14:45:11 +0600

Tags: patch

[ resent from
  http://lists.gnu.org/archive/html/emacs-devel/2008-11/msg00104.html ]

	tcl.el reads:

--cut: http://cvs.savannah.gnu.org/viewvc/*checkout*/emacs/emacs/lisp/progmodes/tcl.el?revision=1.93--
(defun tcl-filter (proc string)
  (let ((inhibit-quit t))
    (with-current-buffer (process-buffer proc)
      (goto-char (process-mark proc))
      ;; Delete prompt if requested.
      (if (marker-buffer inferior-tcl-delete-prompt-marker)
	  (progn
	    (delete-region (point) inferior-tcl-delete-prompt-marker)
	    (set-marker inferior-tcl-delete-prompt-marker nil)))))
  (comint-output-filter proc string))
--cut: http://cvs.savannah.gnu.org/viewvc/*checkout*/emacs/emacs/lisp/progmodes/tcl.el?revision=1.93--

	Thus, the point is moved every time there is a new output from
	Tcl.  Shouldn't it be like the following instead?

--- tcl.el?revision=1.93
+++ tcl.el
@@ -1031,11 +1031,11 @@
 (defun tcl-filter (proc string)
   (let ((inhibit-quit t))
     (with-current-buffer (process-buffer proc)
-      (goto-char (process-mark proc))
       ;; Delete prompt if requested.
       (if (marker-buffer inferior-tcl-delete-prompt-marker)
 	  (progn
-	    (delete-region (point) inferior-tcl-delete-prompt-marker)
+	    (delete-region (process-mark proc)
+			   inferior-tcl-delete-prompt-marker)
 	    (set-marker inferior-tcl-delete-prompt-marker nil)))))
   (comint-output-filter proc string))

	If such scrolling is desired, the `comint-move-point-for-output'
	variable could be set non-nil.