由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - Re: 为什么emacs自动给我加^M.
相关主题
关于emacs一问。请问怎样知道别人copy了我的程序
how to get rid of the ^M in files?console halt problem when using >>pico<<
unix 可以安装在 pc 上吗?unix/dos/mac mode in emacs
emacs中如何去指定一行My thought Re: beginner's question: Emacs vs. vi
一个很丢人的问题[转载] HOw to use Emacs as Xterm?
HP Unix help ?( floppy disk mount)help on emacs / replace
beginner's question: Emacs vs. vi关于ssh的问题
A quick emacs question在x-win的matlab中按了一个键,suspend了
相关话题的讨论汇总
话题: emacs话题: dos2unix话题: cut话题: ctrlm话题: 我加
进入Unix版参与讨论
1 (共1页)
y***g
发帖数: 6
1
How about command" dos2unix"
c*****t
发帖数: 1879
2
hoho, 除了用 dos2unix 外, 在 emacs 里去掉 ^M 也很容易.
首先到第一行末尾, 在 ^M 前, 打 ^k (Ctrl-k) 将 ^M 吃掉.
然后打 M-x replace-string (enter) 进入 search/replace
mode, 然后打 ^y 把 ^M 给 paste 进去, 再连打两个 (enter)
key 就行了.
在 search/replace mode 里使用 ^y 可以将多行文字, 包括
^M, ^J 等删掉.
b**s
发帖数: 67
3
put following in your .emacs
(global-set-key [f5] 'cut-ctrlM) ; cut all ^M.
;; prevent echoing ^M in the shell (a hard one)
(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t)
;if you encounter a file with ^M or ... at the end of every line,
;this means a worng copy by samba or floppy disk of the DOS file to UNIX.
;get rid of them by pressing [F5]
(defun cut-ctrlM ()
"Cut all visible ^M."
(interactive)
(beginning-of-buffer)
(while (search-forward "\
1 (共1页)
进入Unix版参与讨论
相关主题
在x-win的matlab中按了一个键,suspend了一个很丢人的问题
[转载] 如何屏蔽掉CTRL-Z(UNIX的TERMINAL) 急 HP Unix help ?( floppy disk mount)
[转载] Re: 如何屏蔽掉CTRL-Z(UNIX的TERMINAL) 急beginner's question: Emacs vs. vi
有关Unix shell script的问题A quick emacs question
关于emacs一问。请问怎样知道别人copy了我的程序
how to get rid of the ^M in files?console halt problem when using >>pico<<
unix 可以安装在 pc 上吗?unix/dos/mac mode in emacs
emacs中如何去指定一行My thought Re: beginner's question: Emacs vs. vi
相关话题的讨论汇总
话题: emacs话题: dos2unix话题: cut话题: ctrlm话题: 我加