]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-dynamic-complete-filename) [ms-dos, windows-nt]:
authorRichard M. Stallman <rms@gnu.org>
Wed, 5 Jun 1996 18:24:14 +0000 (18:24 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 5 Jun 1996 18:24:14 +0000 (18:24 +0000)
Always use backslash as a directory separator when completing
in shell mode on these systems.

(comint-unquote-filename): Handle quoted backslashes.

lisp/comint.el

index fca83137fdd8d708a105ef11ae3193a50463db54..c7522fefff7d0daed25713c46f8214e7abc088a0 100644 (file)
@@ -1880,8 +1880,10 @@ Magic characters are those in `comint-file-name-quote-list'."
   (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 @@ completions listing is dependent on the value of `comint-completion-autolist'.
 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.