changeset 104137:974fca280203

* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New defconst. (tramp-rfn-eshadow-update-overlay): Use it.
author Michael Albinus <michael.albinus@gmx.de>
date Mon, 03 Aug 2009 08:21:29 +0000
parents a951b4e69c77
children 1f05feb52986
files lisp/net/tramp.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp.el	Sun Aug 02 23:51:54 2009 +0000
+++ b/lisp/net/tramp.el	Mon Aug 03 08:21:29 2009 +0000
@@ -2196,6 +2196,9 @@
 	       (remove-hook 'rfn-eshadow-setup-minibuffer-hook
 			    'tramp-rfn-eshadow-setup-minibuffer))))
 
+(defconst tramp-rfn-eshadow-update-overlay-regexp
+  (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format))
+
 (defun tramp-rfn-eshadow-update-overlay ()
   "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input.
 This is intended to be used as a minibuffer `post-command-hook' for
@@ -2209,7 +2212,10 @@
       (save-excursion
 	(save-restriction
 	  (narrow-to-region
-	   (1+ (or (string-match "/" (buffer-string) end) end)) (point-max))
+	   (1+ (or (string-match
+		    tramp-rfn-eshadow-update-overlay-regexp (buffer-string) end)
+		   end))
+	   (point-max))
 	  (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
 		(rfn-eshadow-update-overlay-hook nil))
 	    (move-overlay rfn-eshadow-overlay (point-max) (point-max))