all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#6136: Emerge doesn't handle file names with spaces on MS Windows
@ 2010-05-07 19:19 Joakim Hårsman
  2010-05-08 15:08 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Joakim Hårsman @ 2010-05-07 19:19 UTC (permalink / raw)
  To: 6136

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 "\""))


Here's some output which might be useful:
GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-30 on SOFT-MJASON







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-06 14:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-08-06 14:06   ` npostavs
2016-08-06 14:46     ` Eli Zaretskii

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.