From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: shell-command - missing shell-quote-argument for program? Date: Sun, 15 Oct 2006 21:08:13 +0200 Message-ID: <4532871D.9030706@student.lu.se> References: <452517DC.5010007@student.lu.se> <45251C56.8010603@student.lu.se> <4526434B.9010606@student.lu.se> <452AC9D6.9030602@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1160944740 4921 80.91.229.2 (15 Oct 2006 20:39:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Oct 2006 20:39:00 +0000 (UTC) Cc: worley@world.std.com, t.link@gmx.at, briot@gnat.com, Emacs Devel , Holger.Schauer@gmx.de, storm@cua.dk, pbreton@cs.umb.edu, pk_at_work@yahoo.com, dominik@science.uva.nl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 15 22:38:58 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GZCl3-0008Hu-Rw for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2006 22:38:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GZCl2-0006OO-Ub for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2006 16:38:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GZBLZ-0008PY-N9 for emacs-devel@gnu.org; Sun, 15 Oct 2006 15:08:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GZBLT-0008Dc-IC for emacs-devel@gnu.org; Sun, 15 Oct 2006 15:08:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GZBLS-0008D8-TK for emacs-devel@gnu.org; Sun, 15 Oct 2006 15:08:22 -0400 Original-Received: from [80.76.149.213] (helo=ch-smtp02.sth.basefarm.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GZBUO-00065s-AB; Sun, 15 Oct 2006 15:17:36 -0400 Original-Received: from c83-249-218-244.bredband.comhem.se ([83.249.218.244]:62859 helo=[192.168.123.121]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1GZBLN-0005vt-7j; Sun, 15 Oct 2006 21:08:17 +0200 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) Original-To: Dave Love In-Reply-To: X-Scan-Result: No virus found in message 1GZBLN-0005vt-7j. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1GZBLN-0005vt-7j affee839e9b529ac74e2bd0ccc5c470b X-Mailman-Approved-At: Sun, 15 Oct 2006 16:37:22 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60770 Archived-At: Dave Love wrote: > Lennart Borgman 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?