]> code.delx.au - gnu-emacs/blobdiff - lisp/w32-fns.el
(ps-mule-begin-job): Redo this change "if
[gnu-emacs] / lisp / w32-fns.el
index 33db6c011d54ffd74f229056b45146be8f22a3fa..580bea0631ad109719d441385c965ec28b10d464 100644 (file)
@@ -137,6 +137,26 @@ You should set this to t when using a non-system shell.\n\n"))))
 
 (add-hook 'after-init-hook 'w32-check-shell-configuration)
 
+;;; Override setting chosen at startup.
+(defun set-default-process-coding-system ()
+  ;; Most programs on Windows will accept Unix line endings on input
+  ;; (and some programs ported from Unix require it) but most will
+  ;; produce DOS line endings on output.
+  (setq default-process-coding-system
+       (if default-enable-multibyte-characters
+           '(undecided-dos . undecided-unix)
+         '(raw-text-dos . raw-text-unix)))
+  (or (w32-using-nt)
+      ;; On Windows 9x, make cmdproxy default to using DOS line endings
+      ;; for input, because command.com requires this.
+      (setq process-coding-system-alist
+           `(("[cC][mM][dD][pP][rR][oO][xX][yY]"
+              . ,(if default-enable-multibyte-characters
+                     '(undecided-dos . undecided-dos)
+                   '(raw-text-dos . raw-text-dos)))))))
+
+(add-hook 'before-init-hook 'set-default-process-coding-system)
+
 
 ;;; Basic support functions for managing Emacs' locale setting
 
@@ -234,10 +254,12 @@ with a definition that really does change some file names."
       (aset name (match-beginning 0) ?!)
       (setq start (match-end 0)))
     ;; convert directory separators to Windows format
-    (while (string-match "/" name start)
-      (aset name (match-beginning 0) ?\\)
-      (setq start (match-end 0)))
-    name))
+    ;; (but only if the shell in use requires it)
+    (if (w32-shell-dos-semantics)
+       (while (string-match "/" name start)
+         (aset name (match-beginning 0) ?\\)
+         (setq start (match-end 0))))
+      name))
 
 ;;; Fix interface to (X-specific) mouse.el
 (defun x-set-selection (type data)