[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell-command - missing shell-quote-argument for program?

From: Lennart Borgman
Subject: Re: shell-command - missing shell-quote-argument for program?
Date: Sun, 15 Oct 2006 21:08:13 +0200
User-agent: Thunderbird (Windows/20060909)

Dave Love wrote:
Lennart Borgman <address@hidden> writes:

Thanks for responding. I am sorry if I were not clear enough about the
problem. The problem is that when you call shell-command (or
shell-command-to-string) the arguments may need to be quoted so that
the shell does not mistreat them.

??  Shell-quoting the args would break them unless they comprise a
single shell word, in which case there's no point.
There must be some misunderstanding here, but please let us not discuss this now. I think we have resolved most of the issues I have been complaining about here.

A common example is file names with
spaces in them. If a file name with spaces are used as argument to
shell-command it must be quoted. Otherwise the shell will treat it as
several arguments.

Well, that's different; maybe that's what you meant by the first bit.
If you're composing a shell command you have to DTRT, but
`shell-command-to-string' is probably the least of your problems with
file names that shells split.  You shouldn't normally use
`shell-command' non-interactively.

Why don't you submit patches?  It's still not clear to me what you're
complaining about.  There are surely more serious Emacs issues to work
on, though.
These are possible bugs and I consider them serious. The most common problem is that with file names containing spaces.

I found examples of what I suspected was missing quoting in the files
I mentioned and I therefore mailed you as authors (since there is no
maintainer mentioned in the files).

If you sent to me because of python.el, the maintainer is supposed to
be FSF, unfortunately.  (I assume you mean the version in the Emacs
sources rather than the fixed and enhanced one I maintain.)
Yes, but I wanted your opinion only.

- emerge.el
According to Dave it is probably obsolete and replaced by ediff. Then
I will just leave emerge.el as it is.

If it's not in lisp/obsolete it still needs to be maintained.  It's
also documented in the manual, rather than Ediff, unfortunately.
Looks like you are right.

- progmodes/python.el: python-after-info-look: python-command

I don't have the Emacs CVS version to hand, but if that has a problem,
please chase whoever changed it.  In my version the only instance of
`shell-command' is:
   (shell-command-to-string (concat python-command " -V"))
and I don't understand what you mean by referring to python-command.
Have you read its doc (or has that been changed too)?
My impression right now is that this special case could not be quoted since python-command could be a file name with arguments.

The thing that is/was wrong in principle with command arg processing
in python.el is `python-args-to-list' -- see its fixme.  Similarly for
anything else that's copied the mechanism from cmuscheme.el.  (The
inferior interpreter mechanism is one of the things which should be
abstracted, though, rather than fixing individual versions IMNSHO.)
Thanks for the pointer. Has this been fixed in the version of python.el that you maintain yourself?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]