· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Removing^MIn Emacs

Emacs¿¡¼­ "^M" ¹®ÀÚ ¾ø¾Ö±â

ÀϹÝÀûÀ¸·Î "^M" ÀÌ »ý±â´Â ¿øÀÎÀº
MSÀ©µµ¿ì´Â ¶óÀÎ ³¡À» CR+LF·Î ³ªÅ¸³»°í ¸®´ª½º´Â LF·Î ³ªÅ¸³»¼­ ÀÔ´Ï´Ù.

¾ø¾Ö´Â ¹æ¹ýÀº
C-x RET r (revert-buffer-with-coding-system)

¹Ì´Ï¹öÆÛ¿¡ ¾Æ·¡Ã³·³ ³ª¿À¸é ¡°dos¡± ÀÔ·Â
Coding system for visited file (default nil): dos
¾Æ·¡ ¸Þ¼¼Áö ³ª¿À¸é ¡°yes¡± ÀÔ·Â
Revert buffer from file °æ·Î/ÆÄÀϸí? (yes or no) yes

±×¸®°í ¿µ±¸ÀûÀ¸·Î "^M"À» ¾ø¾Ù·Á¸é À§ °úÁ¤À» ÇÏ°í
C-x RET f (set-buffer-file-coding-system)

¹Ì´Ï¹öÆÛ¿¡ ¾Æ·¡Ã³·³ ³ª¿À¸é ¡°unix¡± ÀÔ·Â
Coding system for saving file (default nil): unix
C-x C-s (save-buffer) ·Î ¹öÆÛ ÀúÀå

.emacs ÆÄÀÏ¿¡¼­ ¾µ ¼ö ÀÖ´Â ¿¹Á¦ Å°¹ÙÀεù
(global-set-key [(control x)(?\r)(f7)] '(lambda () (interactive) (revert-buffer-with-coding-system 'dos) )  )
(global-set-key [(control x)(?\r)(f8)] '(lambda () (interactive) (revert-buffer-with-coding-system 'unix) )  )

(global-set-key [(control x)(?\r)(control f7)] '(lambda () (interactive) (set-buffer-file-coding-system 'dos) )  )
(global-set-key [(control x)(?\r)(control f8)] '(lambda () (interactive) (set-buffer-file-coding-system 'unix) )  )
(?\r)´ë½Å (return)À» »ç¿ëÇÏ¸é ±âÁ¸¿¡ ÀÖ´ø C-x RET ¸¦ prefix command·Î »ç¿ëÇÏ´Â Å°¹ÙÀεùÀÌ ÀÛµ¿À» ¾ÈÇÏ°Ô µË´Ï´Ù. ²À (?\r)¸¦ »ç¿ëÇϼ¼¿ä.

Âü°í:
¸Þ¼¼Áö ÀÀ´äÀ» yes or no ·Î ÀÔ·Â ¾ÈÇÏ°í y or n ·Î ÇÏ°í ½ÍÀ¸½Å ºÐÀº .emacs ÆÄÀÏ¿¡ ¾Æ·¡ ³»¿ë ³ÖÀ¸¼¼¿ä.
(fset 'yes-or-no-p 'y-or-n-p)

ÆÄÀÏÀÌ ±úÁ®À־ À§ ¹æ¹ýÀÌ ¾È ÅëÇÑ´Ù¸é ¾Æ·¡Ã³·³ °­Á¦·Î "^M"¸¦ Á¦°ÅÇÏ´Â ¹æ¹ýµµ ÀÖ½À´Ï´Ù.
http://nberserk.tistory.com/entry/removing-M-character-in-emacs


(!) primewizard - 20081026

ID
Password
Join
You will soon meet a person who will play an important role in your life.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2008-10-26 16:04:31
Processing time 0.0035 sec