From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#6136: Emerge doesn't handle file names with spaces on MS Windows Date: Sat, 08 May 2010 18:08:01 +0300 Message-ID: <838w7uqvn2.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1273332418 4786 80.91.229.12 (8 May 2010 15:26:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 8 May 2010 15:26:58 +0000 (UTC) Cc: 6136@debbugs.gnu.org To: Joakim =?UTF-8?Q?H=C3=A5rsman?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 08 17:26:55 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@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 1OAlvT-0007jl-Nl for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 May 2010 17:26:54 +0200 Original-Received: from localhost ([127.0.0.1]:46282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAlv8-00011C-So for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 May 2010 11:26:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OAlv2-00010k-WC for bug-gnu-emacs@gnu.org; Sat, 08 May 2010 11:26:21 -0400 Original-Received: from [140.186.70.92] (port=58525 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAlv1-00010C-QS for bug-gnu-emacs@gnu.org; Sat, 08 May 2010 11:26:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAlv0-0003KT-2w for bug-gnu-emacs@gnu.org; Sat, 08 May 2010 11:26:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33336) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAlv0-0003KO-18 for bug-gnu-emacs@gnu.org; Sat, 08 May 2010 11:26:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OAlgE-00026y-GO; Sat, 08 May 2010 11:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 May 2010 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6136 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6136-submit@debbugs.gnu.org id=B6136.12733314118107 (code B ref 6136); Sat, 08 May 2010 15:11:02 +0000 Original-Received: (at 6136) by debbugs.gnu.org; 8 May 2010 15:10:11 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAlfO-00026i-Br for submit@debbugs.gnu.org; Sat, 08 May 2010 11:10:10 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAlfL-00026R-WA for 6136@debbugs.gnu.org; Sat, 08 May 2010 11:10:09 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0L2300H00WPP7A00@a-mtaout23.012.net.il> for 6136@debbugs.gnu.org; Sat, 08 May 2010 18:10:07 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.229.0.144]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L2300FYXWSOP050@a-mtaout23.012.net.il>; Sat, 08 May 2010 18:10:01 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 08 May 2010 11:11:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36795 Archived-At: > Date: Fri, 7 May 2010 21:19:36 +0200 > From: Joakim H=C3=A5rsman > Cc:=20 >=20 > If any of the file names supplied to Emerge (e.g to > emerge-files-with-ancestor) has spaces in in its path and Emacs is > running on MS Windows, the merge fails. >=20 > The problem is the way Emerge passes the file names to diff, it tri= es > to escape spaces (and other metchars) with backslashes, but that > doesn't work on MS Windows since the backslash is a path separator > there. >=20 > If I change the definition of emerge-protect-metachars to the > following it works: >=20 > (defun emerge-protect-metachars (s) > (if (member system-type '(windows-nt ms-dos)) > (emerge-protect-metachars-win s) > (emerge-protect-metachars-nix s))) >=20 > (defun emerge-protect-metachars-nix (s) > (let ((limit 0)) > (while (string-match emerge-metachars s limit) > (setq s (concat (substring s 0 (match-beginning 0)) > =09=09 "\\" > =09=09 (substring s (match-beginning 0)))) > (setq limit (1+ (match-end 0))))) > s) >=20 > (defun emerge-protect-metachars-win (s) > (concat "\"" s "\"")) I think emerge-protect-metachars should simply use shell-quote-argument, on all platforms. Then it won't need to distinguish between the different flavors, and it won't need to know which characters need protection, something that is shell-dependent and thus tricky even on Unix. Could you try a patch along those line, and see if it works?