From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.devel Subject: Re: shell-command - missing shell-quote-argument for program? Date: Sun, 15 Oct 2006 14:50:37 +0100 Message-ID: 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=us-ascii X-Trace: sea.gmane.org 1160944658 4703 80.91.229.2 (15 Oct 2006 20:37:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Oct 2006 20:37:38 +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:37:36 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 1GZCjn-00083k-E0 for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2006 22:37:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GZCjm-0005JR-VK for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2006 16:37:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GZ6O6-0001cC-ES for emacs-devel@gnu.org; Sun, 15 Oct 2006 09:50:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GZ6O4-0001Wv-Ag for emacs-devel@gnu.org; Sun, 15 Oct 2006 09:50:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GZ6O4-0001WU-4N for emacs-devel@gnu.org; Sun, 15 Oct 2006 09:50:44 -0400 Original-Received: from [217.158.120.143] (helo=mail.ukfsn.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GZ6Wy-0006M9-1R for emacs-devel@gnu.org; Sun, 15 Oct 2006 09:59:56 -0400 Original-Received: from localhost (84-45-211-153.no-dns-yet.enta.net [84.45.211.153]) by mail.ukfsn.org (Postfix) with ESMTP id 1DB67E6F26; Sun, 15 Oct 2006 14:49:41 +0100 (BST) Original-Received: from fx by localhost with local (Exim 4.60) (envelope-from ) id 1GZ6Ny-0003G0-KS; Sun, 15 Oct 2006 14:50:38 +0100 Original-To: Lennart Borgman X-Draft-From: ("nnml:Misc" 3795) In-Reply-To: <452AC9D6.9030602@student.lu.se> (Lennart Borgman's message of "Tue\, 10 Oct 2006 00\:14\:46 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) 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:60768 Archived-At: 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. > 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.)