all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Mark H. David" <mhd@yv.org>
Cc: 8321@debbugs.gnu.org
Subject: bug#8321: 23.1; emerge error diff extra operand
Date: Tue, 22 Mar 2011 21:48:27 +0200	[thread overview]
Message-ID: <83pqpj7x84.fsf@gnu.org> (raw)
In-Reply-To: <4D88F91F.8020109@yv.org>

> Date: Tue, 22 Mar 2011 15:31:43 -0400
> From: "Mark H. David" <mhd@yv.org>
> 
> Thanks for checking on this so fast!
> 
> Wow, actually having a full pathname with no spaces worked.

If so, I think this is already fixed in the development sources.  Can
you try the patch below?


--- lisp/emerge.el~0	2011-03-10 19:56:29.093750000 +0200
+++ lisp/emerge.el	2011-03-18 23:48:44.187500000 +0200
@@ -3187,21 +3187,26 @@
 
 ;; Metacharacters that have to be protected from the shell when executing
 ;; a diff/diff3 command.
-(defcustom emerge-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
-  "Characters that must be quoted with \\ when used in a shell command line.
+(defcustom emerge-metachars
+  (if (memq system-type '(ms-dos windows-nt))
+      "[ \t\"<>|?*^&=]"
+    "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]")
+  "Characters that must be quoted when used in a shell command line.
 More precisely, a [...] regexp to match any one such character."
   :type 'regexp
   :group 'emerge)
 
 ;; Quote metacharacters (using \) when executing a diff/diff3 command.
 (defun emerge-protect-metachars (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)
+  (if (memq system-type '(ms-dos windows-nt))
+      (shell-quote-argument 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))
 
 (provide 'emerge)
 





  parent reply	other threads:[~2011-03-22 19:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 15:52 bug#8321: 23.1; emerge error diff extra operand Mark H. David
2011-03-22 19:02 ` Eli Zaretskii
     [not found]   ` <4D88F91F.8020109@yv.org>
2011-03-22 19:48     ` Eli Zaretskii [this message]
     [not found]       ` <4D892EE0.2020103@yv.org>
2011-03-23  5:29         ` 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=83pqpj7x84.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=8321@debbugs.gnu.org \
    --cc=mhd@yv.org \
    /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.