From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Space in compiler file name Date: Thu, 23 Feb 2006 11:15:47 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1140860285 19347 80.91.229.2 (25 Feb 2006 09:38:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2006 09:38:05 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 25 10:38:04 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FCvsI-0006Fv-In for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Feb 2006 10:38:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FCvsK-0005WW-3o for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Feb 2006 04:38:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FCjQa-0007GW-AE for help-gnu-emacs@gnu.org; Fri, 24 Feb 2006 15:20:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FCS4B-0005cP-Oz for help-gnu-emacs@gnu.org; Thu, 23 Feb 2006 20:48:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FCL0u-0004h5-45 for help-gnu-emacs@gnu.org; Thu, 23 Feb 2006 13:16:28 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FCL7f-0002BI-8d for help-gnu-emacs@gnu.org; Thu, 23 Feb 2006 13:23:27 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FCL0i-0005io-0Y for help-gnu-emacs@gnu.org; Thu, 23 Feb 2006 19:16:16 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Feb 2006 19:16:16 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Feb 2006 19:16:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 51 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33407 Archived-At: Brian Elmegaard wrote: > Eli Zaretskii writes: > > >>The one with ".." should have worked. Please show the full >>customization command that uses double quotes, perhaps something was >>wrong in how you escaped quotes within a string. > > > Thanks, Eli, you found my mistake. > The problem is that I concatenate the directory path in double quotes > and the file name to get: > "c:/program files/dna/bin"/dna.exe > which obviously doesnøt work. > > Is there a neat way to append inside the quotes? Since the directory name itself does not have quotes, I think the right thing to do is to add the quotes when you generate the shell command, which is what requires them: (setq dna-bin-directory "c:/program files/dna/bin") (setq compile-command (format "\"%s\" %s" (expand-file-name dna-executable-name dna-bin-directory) (file-name-nondirectory buffer-file-name))) Or perhaps (1) make compile-command a buffer local variable, since its value is specific to the buffer and (2) use the shell-quote-argument utility to handle both the program and the file: (set (make-local-variable 'compile-command) (concat (shell-quote-argument (expand-file-name dna-executable-name dna-bin-directory)) " " (shell-quote-argument (expand-file-name (file-name-nondirectory buffer-file-name))))) > Is it correct that emacs outputs: > > 'c:/program' is not recognized as an internal or external command, > operable program or batch file. > > when this error is encountered? That looks like a message from your shell, not Emacs. -- Kevin Rodgers