Re: ^M problem
[email protected] Fri, 4 Nov 2005 18:47:39 -0500
| Newsgroups | gmane.emacs.xemacs.general |
|---|---|
| Message-ID | <OFE64FF9DD.7E457BB8-ON852570AF.00820AE5-852570AF.0082B9F5@iqfinancial.com> |
Jean, Thanks for the info. However, I can't change the file, so, I want to change how emacs _displays_ the file. When it displays lots of ^M's it usually means emacs chose UN*X mode instead of DOS mode. I'd like to dynamically change that mode back to DOS mode, when it happens. It's simply that sometimes it makes the wrong choice between UN*X and DOS mode. Next time it happens, I will play a bit with the buffer-file-* variables, mentioned below... |---------+----------------------------> | | Jean Eid | | | <[email protected]| | | oronto.ca> | | | | | | 11/04/2005 05:45 | | | PM | | | | |---------+----------------------------> >-----------------------------------------------------------------------------------------------------------------| | | | To: [email protected] | | cc: "'[email protected]'" <[email protected]>, "Shyamsundar, Purkayastha (Purkayastha)** | | CTR **" <[email protected]> | | Subject: Re: ^M problem | >-----------------------------------------------------------------------------------------------------------------| I usually use the tool fromdos to overcome this. if you are using debian you can get it by apt-get install sysutils and use fromdos filename. This will take care of it. [email protected] wrote: >1. --------------- > >^M is most likely because you have a file that is a DOS/Windows file, but >is being treated as a Unix file. > >In a Unix file, end of line is marked by a simple line-feed (^J or x'0A'); >in Windows, it is marked by carriage-return, line-feed (^M^J or x'0D0A'). >If you treat a DOS file as a UNIX file, the 0A is processed as a line >terminator, and the 0D becomes simply another character, and is displayed >as a ^M. > >If that is not the case, the next probablility is that there is something >strange about your input file, for example, two ^M's in a row (x'0D0D') or >a ^M without a preceding ^J,, possibly introduced by a program creating the >file or using a different editor that handles line termination in a >different way. > >I would dearly like to know of a way of forcing UNIX or DOS mode, but I >don't think there is. > >I have found it useful to track down the cause of the ^M presentation by >bisecting the file and reloading: >Delete the bottom half of the file. >Save the top half. >Reload the top half. >Still see the problem? Then it's here in the top half. >Don't see the problem? Then it's in the bottom half. > >Repeat until you find the problem. > >2. --------------- > >Perhaps I am overcomplicating things, because I have no idea what ecb is. >Is it possible that there is something equivalent to the shell hook >feature: comint-strip-ctrl-m? That should be described in the ecb doc. >(possibly at the top of ecb.el?). > >3. ---------------- > >You might also want to poke around at the variables: buffer-file-*. There >are several there that you may find interesting... > >HIH. > > > > > "Shyamsundar, > Purkayastha To: "'[email protected]'" <[email protected]> > (Purkayastha)** CTR cc: > **" Subject: ^M problem > <shyamsundar@lucent > .com> > Sent by: > xemacs-news-bounces > @xemacs.org > > > 11/04/2005 09:38 AM > > > > > > >Hi to all > >I am using xemacs v 21.4 with ecb 1.93 >Whenever i activate ecb to view some c++ code files i get a display which >is >full of ^M after every line end.I guess it is the newline which is getting >printed as ^M. I have tried opening those files in other text editors like >kwrite gedit but i dnt get this problem there. > >I tried toggling some display options in xemacs but in vein > >can anybody help me in this regard > >thanks & regards > >Shyamsundar Purkayastha >Lucent Technologies O >Wind Tunnel Road,Golf View Homes, Murgesh Palya >Bangalore 560017 >India > >Ph - +91-80-25052334 >Email - [email protected] >www.lucent.com > > > > > > > > > >