From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: shell-command - missing shell-quote-argument for program? Date: Sun, 15 Oct 2006 01:02:49 +0200 Message-ID: References: <452517DC.5010007@student.lu.se> <45251C56.8010603@student.lu.se> <4531032D.6060708@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 1160867095 29992 80.91.229.2 (14 Oct 2006 23:04:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Oct 2006 23:04:55 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org, Carsten Dominik Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 15 01:04:53 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 1GYsYm-00075D-Hs for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2006 01:04:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GYsYm-0000Li-83 for ged-emacs-devel@m.gmane.org; Sat, 14 Oct 2006 19:04:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GYsXh-0007xY-Gp for emacs-devel@gnu.org; Sat, 14 Oct 2006 19:03:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GYsXg-0007wb-De for emacs-devel@gnu.org; Sat, 14 Oct 2006 19:03:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GYsXg-0007wH-6t for emacs-devel@gnu.org; Sat, 14 Oct 2006 19:03:44 -0400 Original-Received: from [195.41.46.236] (helo=pfepb.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GYsgP-0003VQ-EU; Sat, 14 Oct 2006 19:12:45 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepb.post.tele.dk (Postfix) with SMTP id 5E3CBA50034; Sun, 15 Oct 2006 01:03:30 +0200 (CEST) Original-To: Lennart Borgman In-Reply-To: <4531032D.6060708@student.lu.se> (Lennart Borgman's message of "Sat\, 14 Oct 2006 17\:33\:01 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:60749 Archived-At: Lennart Borgman writes: > Index: flymake.el > =================================================================== > RCS file: /cvsroot/emacs/emacs/lisp/progmodes/flymake.el,v > retrieving revision 1.41 > diff -c -r1.41 flymake.el > *** flymake.el 16 Feb 2006 11:40:51 -0000 1.41 > --- flymake.el 11 Oct 2006 22:57:10 -0000 > *************** > *** 1021,1027 **** > (progn > (flymake-get-project-include-dirs-from-cache basedir)) > ;;else > ! (let* ((command-line (concat "make -C\"" basedir "\" > DUMPVARS=INCLUDE_DIRS dumpvars")) > (output (shell-command-to-string command-line)) > (lines (flymake-split-string output "\n")) > (count (length lines)) > --- 1021,1029 ---- > (progn > (flymake-get-project-include-dirs-from-cache basedir)) > ;;else > ! (let* ((command-line (concat "make -C\"" > ! (shell-quote-argument basedir) > ! "\" DUMPVARS=INCLUDE_DIRS dumpvars")) > (output (shell-command-to-string command-line)) > (lines (flymake-split-string output "\n")) > (count (length lines)) Shouldn't you remove the old quotes here? (let* ((command-line (concat "make -C " (shell-quote-argument basedir) " DUMPVARS=INCLUDE_DIRS dumpvars")) > > Index: ada-xref.el > =================================================================== > RCS file: /cvsroot/emacs/emacs/lisp/progmodes/ada-xref.el,v > retrieving revision 1.26 > diff -c -r1.26 ada-xref.el > *** ada-xref.el 10 Feb 2006 09:00:31 -0000 1.26 > --- ada-xref.el 11 Oct 2006 22:55:48 -0000 > *************** > *** 1916,1923 **** > (set-buffer (get-buffer-create "*grep*")) > (while dirs > (insert (shell-command-to-string > ! (concat "egrep -i -h '^X|" regexp "( |$)' " > ! (file-name-as-directory (car dirs)) "*.ali"))) > (set 'dirs (cdr dirs))) > > ;; Now parse the output > --- 1916,1926 ---- > (set-buffer (get-buffer-create "*grep*")) > (while dirs > (insert (shell-command-to-string > ! (concat "egrep -i -h '^X|" > ! (shell-quote-argument regexp) > ! "( |$)' " > ! (shell-quote-argument (file-name-as-directory (car dirs))) > ! "*.ali"))) > (set 'dirs (cdr dirs))) > > ;; Now parse the output This looks more correct to me: (concat "egrep -i -h " (shell-quote-argument (concat "^X|" regexp "( |$)")) " " (shell-quote-argument (file-name-as-directory (car dirs))) "*.ali"))) -- Kim F. Storm http://www.cua.dk