From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Unwanted ^M in the output from shell-command-on-region Date: Wed, 17 May 2006 10:33:16 +0900 Message-ID: References: <446A3101.5020007@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1147829625 4460 80.91.229.2 (17 May 2006 01:33:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 May 2006 01:33:45 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 17 03:33:42 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FgAuw-0004TF-JS for ged-emacs-devel@m.gmane.org; Wed, 17 May 2006 03:33:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgAuv-0002cd-I6 for ged-emacs-devel@m.gmane.org; Tue, 16 May 2006 21:33:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FgAuh-0002c4-9p for emacs-devel@gnu.org; Tue, 16 May 2006 21:33:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FgAuf-0002bj-Ld for emacs-devel@gnu.org; Tue, 16 May 2006 21:33:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgAuf-0002bg-Fw for emacs-devel@gnu.org; Tue, 16 May 2006 21:33:21 -0400 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FgAxQ-0006aO-8M for emacs-devel@gnu.org; Tue, 16 May 2006 21:36:12 -0400 Original-Received: from nfs.m17n.org (nfs.m17n.org [192.47.44.7]) by tsukuba.m17n.org (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k4H1XHBT031681; Wed, 17 May 2006 10:33:17 +0900 Original-Received: from etlken (etlken.m17n.org [192.47.44.125]) by nfs.m17n.org (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k4H1XHhg007754; Wed, 17 May 2006 10:33:17 +0900 Original-Received: from handa by etlken with local (Exim 3.36 #1 (Debian)) id 1FgAua-0004Wi-00; Wed, 17 May 2006 10:33:16 +0900 Original-To: Lennart Borgman In-reply-to: <446A3101.5020007@student.lu.se> (message from Lennart Borgman on Tue, 16 May 2006 22:07:29 +0200) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) 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:54611 Archived-At: In article <446A3101.5020007@student.lu.se>, Lennart Borgman writes: > This is a problem on w32, but might be more general. I can not > understand how to get rid of ^M from the output of the program Tidy when > I run it with `shell-command-on-region' (or in other ways). From the > documentation it looks like `coding-system-for-read' or > `coding-system-for-write' should be used, but setting them does not > remove ^M. > I have made an example below. It uses the program Tidy from > http://tidy.sourceforge.net/trt/tidy_win32.zip. (Tidy is a program for > (X)HTML curing.) I made this HTML file (with dos coding system): --- temp.html --- ----------------- and run Tidy.exe as this in Cygwin terminal. % Tidy.exe < temp.html 2>&1 | od -c Then the output was like this: 0000000 l i n e 1 c o l u m n 1 0000020 - W a r n i n g : m i s s i 0000040 n g < ! D O C T Y P E > d e 0000060 c l a r a t i o n \r \r \n l i n e 0000100 4 c o l u m n 1 - W a 0000120 r n i n g : d i s c a r d i n 0000140 g u n e x p e c t e d < / h 0000160 t m l > \r \r \n l i n e 2 c o As you see, the output contains \r\r\n sequence. But, undecided-dos docodes only the \r\n sequnce into \n. That's why you see the remaining \r. So, it seems that it is the problem of Tidy.exe. --- Kenichi Handa handa@m17n.org