Re: replacing ^M with emacs

2006-10-30 Thread Giorgos Keramidas
On 2006-10-28 04:18, Tsampros Leonidas [EMAIL PROTECTED] wrote: I think there is something similar in emacs by using the set-buffer-file-coding-system (binded at C-x RET f in default configurations). So to cure and succesfully convert DOS files into unix format, i use C-x RET f unix RET.

Re: replacing ^M with emacs

2006-10-30 Thread Giorgos Keramidas
On 2006-10-27 16:30, Noah [EMAIL PROTECTED] wrote: Thanks Peter, where is the logic here? What is control-q for and what is control-j for? I am trying to figure out how I could have figured that out. also is there a better page than the one I am using below to figure all these

Re: replacing ^M with emacs

2006-10-30 Thread Giorgos Keramidas
On 2006-10-30 10:03, Giorgos Keramidas [EMAIL PROTECTED] wrote: On 2006-10-28 04:18, Tsampros Leonidas [EMAIL PROTECTED] wrote: I think there is something similar in emacs by using the set-buffer-file-coding-system (binded at C-x RET f in default configurations). So to cure and

Re: replacing ^M with emacs

2006-10-28 Thread Malcolm Kay
On Sat, 28 Oct 2006 12:27 pm, Noah wrote: well I am pressing control-J for return not control-M so I dont understand your rationale. There seems to be considerable confusion in this thread between keystrokes and the codes they produce. Most modern keyboards report some form of scan code for

Re: replacing ^M with emacs

2006-10-28 Thread Jerry McAllister
On Fri, Oct 27, 2006 at 07:57:08PM -0700, Noah wrote: well I am pressing control-J for return not control-M so I dont understand your rationale. I don't understand your comment. There was no rationale. That is just what the ASCII characters are used for and a little of the history of how

Re: replacing ^M with emacs

2006-10-28 Thread Jerry McAllister
On Sun, Oct 29, 2006 at 11:30:45AM +1030, Malcolm Kay wrote: On Sat, 28 Oct 2006 12:27 pm, Noah wrote: well I am pressing control-J for return not control-M so I dont understand your rationale. There seems to be considerable confusion in this thread between keystrokes and the codes

replacing ^M with emacs

2006-10-27 Thread Noah
Hi there, It appears that a text editor placed a bunch on ^M throughout a text file I am working with. I assure this is equivalent to eh keystroke control-M. How might I get emacs to search replace also is there a mail list focused specifically on emacs usability? please refer me to it?

Re: replacing ^M with emacs

2006-10-27 Thread Peter A. Giessel
On 2006/10/27 11:26, Noah seems to have typed: How might I get emacs to search replace Put a mark right before the character (control-space) move to right after the character and cut the character (control-w). Move to the top of the document (esc-) and start a query replace (esc-%). Yank in

Re: replacing ^M with emacs

2006-10-27 Thread Giorgos Keramidas
On 2006-10-27 12:26, Noah [EMAIL PROTECTED] wrote: Hi there, It appears that a text editor placed a bunch on ^M throughout a text file I am working with. I assure this is equivalent to eh keystroke control-M. Open the file in Emacs with: M-x find-file-literally RET filename RET and

Re: replacing ^M with emacs

2006-10-27 Thread Derek Ragona
Those ^M's are the MS-DOS EOL character. You can use sed, or tr to remove them via a commandline pipe. -Derek At 02:26 PM 10/27/2006, Noah wrote: Hi there, It appears that a text editor placed a bunch on ^M throughout a text file I am working with. I assure this is equivalent to

Re: replacing ^M with emacs

2006-10-27 Thread Mike Ginsburg
There is a program in ports called unix2dos. With it comes the command dos2unix that automatically goes through the specified file and removes all of the ^M --Mike Ginsburg Derek Ragona wrote: Those ^M's are the MS-DOS EOL character. You can use sed, or tr to remove them via a commandline

Re: replacing ^M with emacs

2006-10-27 Thread Robert Huff
Peter A. Giessel writes: On 2006/10/27 11:26, Noah seems to have typed: How might I get emacs to search replace Put a mark right before the character (control-space) move to right after the character and cut the character (control-w). Move to the top of the document (esc-) and start

Re: replacing ^M with emacs

2006-10-27 Thread Jerry McAllister
On Fri, Oct 27, 2006 at 12:26:25PM -0700, Noah wrote: Hi there, It appears that a text editor placed a bunch on ^M throughout a text file I am working with. I assure this is equivalent to eh keystroke control-M. This is probably MS-DOS type text file. MS text file lines all end in a

Re: replacing ^M with emacs

2006-10-27 Thread Noah
this is the best answer. Hits it right on the head of what I want. What if I want the character to replace the ^M with a new line what do I enter in the replace field? cheers, Noah Peter A. Giessel wrote: On 2006/10/27 11:26, Noah seems to have typed: How might I get emacs to search

Re: replacing ^M with emacs

2006-10-27 Thread Peter A. Giessel
On 2006/10/27 15:20, Noah seems to have typed: this is the best answer. Hits it right on the head of what I want. What if I want the character to replace the ^M with a new line what do I enter in the replace field? control-q control-j ___

Re: replacing ^M with emacs

2006-10-27 Thread Noah
Thanks Peter, where is the logic here? What is control-q for and what is control-j for? I am trying to figure out how I could have figured that out. also is there a better page than the one I am using below to figure all these keystrokes out? http://www.math.uh.edu/~bgb/emacs_keys.html

Re: replacing ^M with emacs

2006-10-27 Thread Darrin Chandler
On Fri, Oct 27, 2006 at 04:20:49PM -0700, Noah wrote: this is the best answer. Hits it right on the head of what I want. What if I want the character to replace the ^M with a new line what do I enter in the replace field? The nice thing about that method is that it'll work for odd

Re: replacing ^M with emacs

2006-10-27 Thread Peter A. Giessel
On 2006/10/27 15:30, Noah seems to have typed: where is the logic here? Logic? I thought we were using emacs here? just kidding... (mostly) What is control-q for As Giorgos posted earlier: The important trick here is that you use C-q to 'quote' the C-m character in the substitution string

Re: replacing ^M with emacs

2006-10-27 Thread Jerry McAllister
Thanks Peter, where is the logic here? What is control-q for and what is control-j for? I am trying to figure out how I could have figured that out. They are ASCII characters. For example, the ^M you wanted to get rid of is CTRL-M.There are ASCII tables in various places. A quick

Re: replacing ^M with emacs

2006-10-27 Thread Tsampros Leonidas
On Fri, Oct 27, 2006 at 05:30:34PM -0400, Jerry McAllister wrote: On Fri, Oct 27, 2006 at 12:26:25PM -0700, Noah wrote: Hi there, It appears that a text editor placed a bunch on ^M throughout a text file I am working with. I assure this is equivalent to eh keystroke control-M.

Re: replacing ^M with emacs

2006-10-27 Thread Noah
well I am pressing control-J for return not control-M so I dont understand your rationale. Jerry McAllister wrote: Thanks Peter, where is the logic here? What is control-q for and what is control-j for? I am trying to figure out how I could have figured that out. They are ASCII