Short answer: Use the variable comint-completion-addsuffix
.
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 \
and 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
- enter
\
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.)
Update:
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):
(insert (comint-quote-filename
(substring (directory-file-name completion)
(length filenondir))))
and doing M-x byte-recompile-directory
.
toggle-backslash-line.el
that flips between '\' and '/' when in comint-mode and that I bound to ctrl-\. It sucks but it's better than nothing...fopen
still the command prompt cannot use "/" for paths because the decision was to use forward slash for options.