changeset 15337:cf1e6f4dd2b0

(comint-dynamic-complete-filename) [ms-dos, windows-nt]: Always use backslash as a directory separator when completing in shell mode on these systems. (comint-unquote-filename): Handle quoted backslashes.
author Richard M. Stallman <rms@gnu.org>
date Wed, 05 Jun 1996 18:24:14 +0000
parents 8d23d63f1eee
children b0d95c32f026
files lisp/comint.el
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Wed Jun 05 17:57:26 1996 +0000
+++ b/lisp/comint.el	Wed Jun 05 18:24:14 1996 +0000
@@ -1880,8 +1880,10 @@
   (if (null comint-file-name-quote-list)
       filename
     (save-match-data
-      (while (string-match "\\\\\\(.\\)" filename)
-	(setq filename (replace-match "\\1" nil nil filename)))
+      (let ((i 0))
+	(while (string-match "\\\\\\(.\\)" filename i)
+	  (setq filename (replace-match "\\1" nil nil filename))
+	  (setq i (+ 1 (match-beginning 0)))))
       filename)))
 
 
@@ -1910,10 +1912,13 @@
 Returns t if successful."
   (interactive)
   (if (comint-match-partial-filename)
-      (prog2 (or (window-minibuffer-p (selected-window))
-		 (message "Completing file name..."))
-	  (comint-dynamic-complete-as-filename))))
-
+      (let ((directory-sep-char ?/))
+	(if (memq system-type '(ms-dos windows-nt))
+	    ; The default shells on these systems require backslashed names
+	    (setq directory-sep-char ?\\))
+	(prog2 (or (window-minibuffer-p (selected-window))
+		   (message "Completing file name..."))
+	    (comint-dynamic-complete-as-filename)))))
 
 (defun comint-dynamic-complete-as-filename ()
   "Dynamically complete at point as a filename.