From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ben Key Newsgroups: gmane.emacs.devel Subject: Re: Supporting parameters that include the = character in configure.bat Date: Sun, 10 Apr 2011 03:46:39 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00032555a81688739104a08c800c X-Trace: dough.gmane.org 1302425243 26195 80.91.229.12 (10 Apr 2011 08:47:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 10 Apr 2011 08:47:23 +0000 (UTC) Cc: Emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 10 10:47:19 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8qIe-0002Y6-W1 for ged-emacs-devel@m.gmane.org; Sun, 10 Apr 2011 10:47:17 +0200 Original-Received: from localhost ([127.0.0.1]:56546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8qIc-0001jN-AG for ged-emacs-devel@m.gmane.org; Sun, 10 Apr 2011 04:47:14 -0400 Original-Received: from [140.186.70.92] (port=34178 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8qIS-0001jF-Mj for Emacs-devel@gnu.org; Sun, 10 Apr 2011 04:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8qIQ-0004hI-BN for Emacs-devel@gnu.org; Sun, 10 Apr 2011 04:47:03 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:33433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8qIO-0004gs-7z; Sun, 10 Apr 2011 04:47:00 -0400 Original-Received: by bwz17 with SMTP id 17so4392858bwz.0 for ; Sun, 10 Apr 2011 01:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=repqduM38ZMuonmTNJGh8po1qta7gxV6Vou3N0VgXpI=; b=TogWEiVF5IrUjV94wqbfxauqfzn0oK1r/K3Qvv2sWW6mqswpZWGZHw/5pVMu/8HMFh +G1RbZBWeTuZgO0BtpPWHaoNDnIUoo4Sd9blkb2HF0RR47OiWg+Z5biKj6n6g08laXya cSDdJ81fgosEqRPEOUHWzc4RkWbswMOCtn7L4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=S709P8F8udRQQRcNsGX09B6s2eBEHW8L5lpIpUXMDmBvZv+VjJFixkyO1fjm379FGU 25JS5r+1+B4ZT3GH2zY3qOplf8jrthMrb93CXi7M8MjdqUNUJU1T/kRA/jDdLMNFetdy kqN0WBodNjMVBXCrj2AQvsAuyrmbGJqa80ENc= Original-Received: by 10.204.17.11 with SMTP id q11mr3496333bka.131.1302425219133; Sun, 10 Apr 2011 01:46:59 -0700 (PDT) Original-Received: by 10.204.118.203 with HTTP; Sun, 10 Apr 2011 01:46:39 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 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:138348 Archived-At: --00032555a81688739104a08c800c Content-Type: text/plain; charset=ISO-8859-1 Hello, Eli Zaretskii wrote: > This isn't a problem, because we don't support building Emacs on > Windows 9X anyway. I was not aware of this. Configure.bat still has some comments that refer to Windows 9x and command.com so I thought it was still a consideration. > So please prepare a patch along these lines. It should include a > corresponding addition to the "usage" text in the batch file and a > similar addition to instructions in nt/INSTALL. Before submitting a patch I wanted to do some more research into this technique to ensure that it will always work. It turns out that the %~1 functionality to strip " characters only works if command extensions are enabled. As far as I know they are always enabled by default but they can be disabled by a system administrator. This means that it will still be necessary to determine if command extensions are enabled before attempting to use this functionality. This can be done as follows. @echo off set use_extensions=1 setlocal enableextensions if errorlevel 1 set use_extensions=0 set sep1= :again if "%1" == "--cflags" goto usercflags if "%1" == "" goto checkutils :usercflags if "%use_extensions%" == "1" goto ucflagex goto ucflag :ucflagex shift set usercflags=%usercflags%%sep1%%~1 set sep1= %nothing% shift goto again :ucflag shift set usercflags=%usercflags%%sep1%%1 set sep1= %nothing% shift goto again :checkutils echo usercflags=%usercflags% I assume that I should use this technique when implementing my patch. If this is what you want me to do, just let me know. --00032555a81688739104a08c800c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

Eli Zaretskii wrote:
> This isn't = a problem, because we don't support building Emacs on
> Windows 9= X anyway.

I was not aware of this.=A0 Configure.bat still has some c= omments that refer to Windows 9x and command= .com so I thought it was still a consideration.

> So please prepare a patch along these lines. =A0It should include = a
> corresponding addition to the "usage" text in the batch file= and a
> similar addition to instructions in nt/INSTALL.

Before submitti= ng a patch I wanted to do some more research into this technique to ensure = that it will always work.=A0 It turns out that the %~1 functionality to str= ip " characters only works if command extensions are enabled.=A0 As fa= r as I know they are always enabled by default but they can be disabled by = a system administrator.=A0 This means that it will still be necessary to de= termine if command extensions are enabled before attempting to use this fun= ctionality.=A0 This can be done as follows.

<batch_file>
@echo off
set use_extensions=3D1
setlocal e= nableextensions
if errorlevel 1 set use_extensions=3D0

set sep1= =3D
:again

if "%1" =3D=3D "--cflags" goto use= rcflags
if "%1" =3D=3D "" goto checkutils

:usercflags
if "%use_extensions%" =3D=3D "1" goto ucflagex
= goto ucflag

:ucflagex
shift
set usercflags=3D%usercflags%%sep1= %%~1
set sep1=3D %nothing%
shift
goto again

:ucflag
shift
set= usercflags=3D%usercflags%%sep1%%1
set sep1=3D %nothing%
shift
got= o again

:checkutils

echo usercflags=3D%usercflags%
</ba= tch_file>

I assume that I should use this technique when implementing my patch.= =A0 If this is what you want me to do, just let me know.


--00032555a81688739104a08c800c--