Date: Mon, 01 Jan 2007 15:20:47 +0100
From: "Lennart Borgman (gmail)" <address@hidden>
CC: Jason Rumney <address@hidden>, address@hidden
(shell-mode)
(when (eq system-type 'windows-nt)
(let* ((shell-file-name prog)
(proc (get-buffer-process (current-buffer)))
(fullprog (executable-find prog))
(cp-out (read (format "cp%s" (w32-get-console-output-codepage))))
(cp-out-dos (coding-system-change-eol-conversion cp-out 'dos))
(cp-out-unix (coding-system-change-eol-conversion cp-out 'unix))
(cp-in (read (format "cp%s" (w32-get-console-codepage))))
(cp-in-dos (coding-system-change-eol-conversion cp-in 'dos))
(cp-in-unix (coding-system-change-eol-conversion cp-in 'unix)))
(cond
((w32-shell-dos-semantics)
(set-process-coding-system proc cp-out-dos cp-in-unix))
((string-match "/msys/" fullprog)
(message "think it is MSYS...")
(set-process-coding-system proc cp-out-dos 'undecided-unix))
((string-match "/cygwin/" fullprog)
(message "think it is Cygwin...")
(set-process-coding-system proc cp-out-dos 'undecided-unix))
(t
(message "unrecognized shell program: %s" fullprog))
)))))
buffer)
Is this what you meant Eli?
Something like that, but I doubt that using cp-out with MSYS and
Cygwin is a good idea, since they don't support that.