How do I get Emacs to fill sentences, but not paragraphs?

前端 未结 10 1057
予麋鹿
予麋鹿 2020-12-23 02:23

I\'ve seen at least two recommendations on StackOverflow to insert newlines between sentences when editing LaTeX documents. The reason being that the practice facilitates so

10条回答
  •  失恋的感觉
    2020-12-23 02:49

    If you put a comment marker at the end of each sentence, Emacs knows not to move the next line inside the comment:

    chat chat chat.%
    A new sentence
    with goofed up wrapping that needs to be fixed.%
    Mumble mumble%
    

    Then M-q fills each sentence separately, at least in AUCTeX 11.85. (If you test this in Emacs, there seems to be a bug where if this is the first paragraph in the buffer and you type M-q, you get an error message. Just put a newline before the text to work around it.)

    If you don't want to type the comment characters, you could take LaTeX-fill-paragraph and modify it so that sentence-ending punctuation at end of line works similarly to comments.

提交回复
热议问题