Short answer: Use the variable
Longer answer: Googling for "emacs shell completion windows" got me to http://www.gnu.org/software/emacs/windows/Sub_002dprocesses.html, which says the variable
comint-completion-addsuffix controls the completion characters. Setting it to a cons of
SPACE does what you want. You can do this with
- M-x customize-variable RET comint-completion-addsuffix RET
- select Value Menu
- select Suffix pair
\ after Directory suffix:
- enter a space character after File suffix:
- select Save for Future Sessions (or Save for current session)
Doing that adds the line
'(comint-completion-addsuffix (quote ("\\" . " ")))
to the correct place in your ~/.emacs file.
(Tested with Emacs 22.3.)
I see what you mean in your comment that with Emacs 23.3 the leading backslash is changed to a slash.
comint-dynamic-complete-filename has been broken so the part of the description
except that it won't change parts of the filename already entered in the buffer is no longer true.
Replacing 23.3's lisp/comint.el with 22.3's seems to work. So does replacing the three lines of that file starting at line 3062:
(delete-region filename-beg filename-end)
(if filedir (insert (comint-quote-filename filedir)))
(insert (comint-quote-filename (directory-file-name completion)))
with these lines (from 22.3):
(substring (directory-file-name completion)