help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using emerge on windows? Funky errors with Temp files


From: Eli Zaretskii
Subject: Re: Using emerge on windows? Funky errors with Temp files
Date: Fri, 18 Mar 2011 23:48:09 +0200

> From: fork <address@hidden>
> Date: Fri, 18 Mar 2011 21:23:07 +0000 (UTC)
> 
> diff: c:/DOCUME\~1/webbs/LOCALS\~1/Temp/emergeA4208Vv8: No such file or 
> directory
> diff: c:/DOCUME\~1/webbs/LOCALS\~1/Temp/emergeB4208e2I: No such file or 
> directory

The patch below should set you up.  (Don't forget to recompile
emerge.el, and then load it or restart Emacs.)

--- lisp/emerge.el~     2011-03-10 19:56:29.093750000 +0200
+++ lisp/emerge.el      2011-03-18 23:42:32.078125000 +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)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]