[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: Dave Love
Subject: Re: shell-command - missing shell-quote-argument for program?
Date: Sun, 15 Oct 2006 14:50:37 +0100
User-agent: Gnus/5.11 (Gnus v5.11)

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.

> 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.

> 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.)

> - 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.

> - 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)?

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.)

reply via email to

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