M-q某种情况有反转unfill-paragraph-function吗?
如果我有撤消数据,那么它当然很容易.我要求的是在我刚从磁盘读取文件后立即将段落中的行合并为单个长行的能力.这样就可以将文本粘贴到一个表单(Web表单等)中,该表单期望每个段落有一个换行符.
在过去,我已经关闭auto-fill,创建了一个宏来删除EOL并移动到下一行,并重复应用它,但这变得很累.
san*_*inc 24
这是答案.简而言之:
(defun unfill-paragraph ()
"Replace newline chars in current paragraph by single spaces.
This command does the reverse of `fill-paragraph'."
(interactive)
(let ((fill-column 90002000))
(fill-paragraph nil)))
(defun unfill-region (start end)
"Replace newline chars in region by single spaces.
This command does the reverse of `fill-region'."
(interactive "r")
(let ((fill-column 90002000))
(fill-region start end)))
Run Code Online (Sandbox Code Playgroud)
更新:我已将它打包在这里,它可以从Marmalade或Melpa安装.