all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Joakim Hårsman" <joakim.harsman@gmail.com>
Cc: 6136@debbugs.gnu.org
Subject: bug#6136: Emerge doesn't handle file names with spaces on MS Windows
Date: Sat, 08 May 2010 18:08:01 +0300	[thread overview]
Message-ID: <838w7uqvn2.fsf@gnu.org> (raw)
In-Reply-To: <h2t89172c761005071219h9c348411scb54844ec85ec930@mail.gmail.com>

> Date: Fri, 7 May 2010 21:19:36 +0200
> From: Joakim Hårsman <joakim.harsman@gmail.com>
> Cc: 
> 
> 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.
> 
> The problem is the way Emerge passes the file names to diff, it tries
> to escape spaces (and other metchars) with backslashes, but that
> doesn't work on MS Windows since the backslash is a path separator
> there.
> 
> If I change the definition of emerge-protect-metachars to the
> following it works:
> 
> (defun emerge-protect-metachars (s)
>   (if (member system-type '(windows-nt ms-dos))
>       (emerge-protect-metachars-win s)
>     (emerge-protect-metachars-nix s)))
> 
> (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))
> 		      "\\"
> 		      (substring s (match-beginning 0))))
>       (setq limit (1+ (match-end 0)))))
>   s)
> 
> (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?







  reply	other threads:[~2010-05-08 15:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 19:19 bug#6136: Emerge doesn't handle file names with spaces on MS Windows Joakim Hårsman
2010-05-08 15:08 ` Eli Zaretskii [this message]
2016-08-06 14:06   ` npostavs
2016-08-06 14:46     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838w7uqvn2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=6136@debbugs.gnu.org \
    --cc=joakim.harsman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.