unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
Cc: 24984@debbugs.gnu.org
Subject: bug#24984: Antw: Re: Antw: Re: bug#24984: Emacs 25.1.1: Problems with file completion in Windows shell
Date: Fri, 25 Nov 2016 10:58:08 +0200	[thread overview]
Message-ID: <83mvgo3pi7.fsf@gnu.org> (raw)
In-Reply-To: <5837FD3D020000A10002361A@gwsmtp1.uni-regensburg.de> (Ulrich.Windl@rz.uni-regensburg.de)

[Please keep the bug address on the CC list.]

> Date: Fri, 25 Nov 2016 08:58:37 +0100
> From: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
> 
> >> This nasty bug makes shell-mode practically unusable; why do you suggest to 
> > close the bug?
> > 
> > Because it isn't a bug in Emacs, it's a user error: cmd.exe requires
> > such names to be quoted.  Am I missing something here?
> 
> Yes (reproduction):
> c:\Users\Ulrich Windl>cd ..
> cd ..
> 
> c:\Users>cd Ulrich Windl/     ### completed from Ul<TAB> (where <TAB> is the TAB key being pressed)
> cd Ulrich Windl/                     ### the command produced by Emacs is without quotes!
> 
> c:\Users\Ulrich Windl>cd Do    ### 1: The chdir seems to have succeeded (see prompt)
> ### "Do<TAB>" does not list any completions, because EMacs thinks the directory is different.
> c:\Users\Ulrich Windl>cd U<TAB> ### lets complete Emacs to "Ulrich Windl" again, because it thinks the directory is "C:\Users"
> ### When executing the "cd", it failes, od course:
> c:\Users\Ulrich Windl>cd Ulrich Windl/
> cd Ulrich Windl/
> Das System kann den angegebenen Pfad nicht finden.
> 
> ### So the shell does things correctly, but Emacs does not.

So you expect Emacs to quote such file names automatically?

Note that the Windows cmd.exe shell does it automatically only in some
cases.  For example:

  C:\>cd Docu TAB

produces

  C:\>cd "Documents and Settings"

as you'd expect, but

  C:\>cd Documents and Settings\My TAB

does not, it simply fails to complete.  Instead, you need to type
this:

  C:\>cd "Documents and Settings\My TAB

i.e. start the file name with a quote.

So there's no consistency in what the shell does here, either.

> Specifically if EMacs completes a name containing a space without putting quotes around, you cannot complein the shell for it (Compare to BASH: It does the quoting correctly is such a case)

What I see in "M-x shell" with Bash (on a GNU/Linux system) is not
entirely correct either:

  $ cd /home/e/eliz/foo TAB

produces

  $ cd /home/e/eliz/foo\ bar\ baz/

which is correct.  But

  $ cd '/home/e/eliz/foo TAB

produces this:

  $ cd '/home/e/eliz/foo\ bar\ baz/'
  bash: cd: /home/e/eliz/foo\ bar\ baz/: No such file or directory

If you try the same from the Bash command line, it does work
correctly: Bash completes "'foo " into "'foo bar baz'/", with the
closing quote and the slash added.

So my conclusion is that completion of such file names in "M-x shell"
does not work reliably on Posix hosts, either.

I'm okay with leaving this bug report open, with its subject retitled
"Completion of file names with embedded white space is broken in 'M-x
shell'", if you agree with my analysis.

Thanks.





  parent reply	other threads:[~2016-11-25  8:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22  9:12 bug#24984: Emacs 25.1.1: Problems with file completion in Windows shell Ulrich Windl
2016-11-22  9:16 ` bug#24984: Acknowledgement (Emacs 25.1.1: Problems with file completion in Windows shell) Ulrich Windl
2016-11-22 15:49 ` bug#24984: Emacs 25.1.1: Problems with file completion in Windows shell Eli Zaretskii
     [not found]   ` <58355F63020000A1000235CE@gwsmtp1.uni-regensburg.de>
2016-11-24 17:29     ` bug#24984: Antw: " Eli Zaretskii
2016-11-24 21:05       ` bug#24984: Antw: " Ulrich Windl
2016-11-25  7:14         ` Eli Zaretskii
     [not found]           ` <5837FD3D020000A10002361A@gwsmtp1.uni-regensburg.de>
2016-11-25  8:58             ` Eli Zaretskii [this message]
2019-11-11  3:20           ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mvgo3pi7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24984@debbugs.gnu.org \
    --cc=Ulrich.Windl@rz.uni-regensburg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).