【发布时间】:2017-03-04 11:24:58
【问题描述】:
当我手动使用 fill-paragraph 时,我想让 emacs 删除所有以前插入的连字符(其他人?)。这意味着自动将所有"-\n" 替换为""。
我该怎么做?
【问题讨论】:
标签: emacs hyphenation
当我手动使用 fill-paragraph 时,我想让 emacs 删除所有以前插入的连字符(其他人?)。这意味着自动将所有"-\n" 替换为""。
我该怎么做?
【问题讨论】:
标签: emacs hyphenation
我可以想象在某些情况下效果不佳,但是...
(defadvice fill-delete-newlines (before my-before-fill-delete-newlines)
"Replace -\\n with an empty string when calling `fill-paragraph'."
(when (eq this-command 'fill-paragraph)
(goto-char (ad-get-arg 0))
(while (search-forward "-\n" (ad-get-arg 1) t)
(replace-match "")
(ad-set-arg 1 (- (ad-get-arg 1) 2)))))
(ad-activate 'fill-delete-newlines)
【讨论】: