作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有时希望将段落中的每个句子放在单独的行上。例如,这使得区分大文本文档变得更容易,因为一个句子的变化不会影响整个段落。一些标记系统(例如 *roff)还要求每个句子都从新行开始。
有没有办法,例如明智地重新定义paragraph-separate
和 paragraph-start
, 制作 fill-paragraph
停在句子之间?
(注意:我使用 Emacs 23.3.1)
更新:示例 mdoc (*roff) 标记:
The
.Nm
utility makes a series of passes with increasing block sizes.
In each pass, it either reads or writes (or both) a number of
non-consecutive blocks at increasing offsets relative to the ideal
alignment, which is assumed to be multiples of the block size.
The results are presented in terms of time elapsed, transactions per
second and kB per second.
fill-paragraph
将其转化为
The
.Nm
utility makes a series of passes with increasing block sizes. In each
pass, it either reads or writes (or both) a number of non-consecutive
blocks at increasing offsets relative to the ideal alignment, which is
assumed to be multiples of the block size. The results are presented
in terms of time elapsed, transactions per second and kB per second.
fill-paragraph
对单个句子进行操作,即我想将段落重新定义为在空白行或上一段结尾之后开始,并以句点结尾,后跟换行符或至少两个空白字符。 fill-paragraph
将一段文本分成单独的句子,但我认为这并不容易。 The
.Nm
utility makes a series of passes with increasing block sizes.
In each pass, it either reads or writes (or both) a number of non-consecutive blocks at increasing offsets relative to the ideal alignment, which is assumed to be multiples of the block size.
The results are presented in terms of time elapsed, transactions per second and kB per second.
M-q
,我应该得到以下信息:
The
.Nm
utility makes a series of passes with increasing block sizes.
In each pass, it either reads or writes (or both) a number of
non-consecutive blocks at increasing offsets relative to the ideal
alignment, which is assumed to be multiples of the block size.
The results are presented in terms of time elapsed, transactions per second and kB per second.
最佳答案
怎么样告诉paragraph-start
查找以大写字母开头的任何行:
"\f\\|[ ]*$\\|^[A-Z]"
\\^[A-Z]
"\f\\|[ ]*$\\|^[ ]*[A-Z]"
case-fold-search
为此,否则在匹配中不区分大写和小写字母!
M-q
(您可以根据需要在本地或全局范围内执行此操作)。
(defun my-fill-paragraph ()
(interactive)
(let ((case-fold-search nil))
(fill-paragraph)))
关于emacs - 有没有办法让 `fill-paragraph` 在句末停止?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7554324/
我是一名优秀的程序员,十分优秀!