所以在 Emacs 中,自动换行称为填充,由M-q
or完成M-x fill-paragraph
。有没有办法修改这个函数来尊重应该是不间断的空间?例如,如果我们有以下句子:
This is a black sentence with a yellow word at the end.
并告诉 Emacs 在标记 50 处填充段落,它像这样包装它:
This is a black sentence with a yellow word at the
end.
但是,如果我对C-u M-x shell-command-on-region
和 enter做同样的事情fold -sw 50
,我会得到以下(正确的)输出:
This is a black sentence with a yellow word at
the end.
当句尾后面跟着括号中的内容时,也会发生类似的问题:
This is a black sentence with a yellow word here. (This is something in parens)
M-q
上面的句子在标记 50 处以下列方式包裹:
This is a black sentence with a yellow word
here. (This is something in parens)
但是,fold -sw 50
正确包装它:
This is a black sentence with a yellow word here.
(This is something in parens)
我知道我可以编写一个使用fold
并使用它的函数,但我很好奇为什么fill-paragraph
会这样以及是否可以修改它。