Subject: Improved patch

From: Dima Kogan <[email-masked]>
Date: Mon, 30 Sep 2013 00:52:14 -0700

I'm attaching a smaller patch that solves this in a somewhat cleaner
way.

>From 5fd5f6f5fed3d5736c7a4267d2487c2dd2861d08 Mon Sep 17 00:00:00 2001
From: Dima Kogan <[email-masked]>
Date: Mon, 30 Sep 2013 00:30:28 -0700
Subject: [PATCH] TRAMP processes no longer delete their buffer contents after
 (point)

---
 lisp/net/tramp-sh.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 4bc836b..81f0c97 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2724,7 +2724,7 @@ the result will be a local, non-Tramp, filename."
 		;; `verify-visited-file-modtime'.
 		(let ((buffer-undo-list t)
 		      (buffer-read-only nil)
-		      (mark (point)))
+		      (point-prompt-start (point-max)))
 		  (clear-visited-file-modtime)
 		  (narrow-to-region (point-max) (point-max))
 		  ;; We call `tramp-maybe-open-connection', in order
@@ -2732,7 +2732,7 @@ the result will be a local, non-Tramp, filename."
 		  (catch 'suppress
 		    (tramp-maybe-open-connection v)
 		    (widen)
-		    (delete-region mark (point))
+		    (delete-region point-prompt-start (point))
 		    (narrow-to-region (point-max) (point-max))
 		    ;; Now do it.
 		    (if command
-- 
1.8.3.2