From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: Codepages and shell function on w32 Date: Tue, 02 Jan 2007 16:39:14 +0100 Message-ID: <459A7CA2.5010005@gmail.com> References: <4597B981.9020506@gmail.com> <45987A73.6040702@gmail.com> <4598A548.7040702@gnu.org> <459918BF.503@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1167752380 6396 80.91.229.12 (2 Jan 2007 15:39:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Jan 2007 15:39:40 +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 16:39:39 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 1H1ljm-000640-P6 for ged-emacs-devel@m.gmane.org; Tue, 02 Jan 2007 16:39:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1ljm-0001LV-8k for ged-emacs-devel@m.gmane.org; Tue, 02 Jan 2007 10:39:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H1ljW-0001Hc-R3 for emacs-devel@gnu.org; Tue, 02 Jan 2007 10:39:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H1ljU-0001Fq-P4 for emacs-devel@gnu.org; Tue, 02 Jan 2007 10:39:22 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1ljU-0001Fj-KS for emacs-devel@gnu.org; Tue, 02 Jan 2007 10:39:20 -0500 Original-Received: from [80.76.149.213] (helo=ch-smtp02.sth.basefarm.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H1ljQ-0001lU-48; Tue, 02 Jan 2007 10:39:16 -0500 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:61581 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1H1ljO-0006p8-7U; Tue, 02 Jan 2007 16:39:14 +0100 User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) Original-To: Eli Zaretskii In-Reply-To: X-Antivirus: avast! (VPS 0666-1, 2006-12-31), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1H1ljO-0006p8-7U. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1H1ljO-0006p8-7U 33c59e55d540fe7ff733d50feffa88ea 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:64638 Archived-At: Eli Zaretskii wrote: >> 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. > The only reason to use cp-out-dos for MSYS and Cygwin is that this makes the output correct for w32 console programs they may run. However I do not know if it creates some problems since I do not know the char tables very well. Maybe it is better to just leave the coding system for MSYS and Cygwin as before?. Do we agree about the cmdproxy part? How about installing that?