From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Codepages and shell function on w32 Date: Tue, 02 Jan 2007 06:26:33 +0200 Message-ID: References: <4597B981.9020506@gmail.com> <45987A73.6040702@gmail.com> <4598A548.7040702@gnu.org> <459918BF.503@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1167712019 7297 80.91.229.12 (2 Jan 2007 04:26:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Jan 2007 04:26:59 +0000 (UTC) Cc: emacs-devel@gnu.org, jasonr@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 02 05:26:57 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H1bEm-0005b7-HK for ged-emacs-devel@m.gmane.org; Tue, 02 Jan 2007 05:26:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1bEm-0006Xs-17 for ged-emacs-devel@m.gmane.org; Mon, 01 Jan 2007 23:26:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H1bEW-0006Wh-AC for emacs-devel@gnu.org; Mon, 01 Jan 2007 23:26:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H1bEU-0006VM-Fj for emacs-devel@gnu.org; Mon, 01 Jan 2007 23:26:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1bEU-0006VB-Bv for emacs-devel@gnu.org; Mon, 01 Jan 2007 23:26:38 -0500 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H1bES-0000lX-1X; Mon, 01 Jan 2007 23:26:36 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-147-218.inter.net.il [80.230.147.218]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id GRU27318 (AUTH halo1); Tue, 2 Jan 2007 06:26:29 +0200 (IST) Original-To: "Lennart Borgman (gmail)" In-reply-to: <459918BF.503@gmail.com> (lennart.borgman@gmail.com) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64627 Archived-At: > Date: Mon, 01 Jan 2007 15:20:47 +0100 > From: "Lennart Borgman (gmail)" > CC: Jason Rumney , emacs-devel@gnu.org > > (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.