Emacs填写段落,不在预期的地方断行

Emacs填写段落,不在预期的地方断行,emacs,fill,paragraph,Emacs,Fill,Paragraph,我有以下HTML代码(一个列表项)。内容并不重要——问题是第2行的结尾 <li>Yes, you can learn how to play piano without becoming a great notation reader, however, <strong class="warning">you <em class="emphatic">will</em> have to acquire a <em class="e

我有以下HTML代码(一个列表项)。内容并不重要——问题是第2行的结尾

<li>Yes, you can learn how to play piano without becoming a
  great notation reader,
  however, <strong class="warning">you <em class="emphatic">will</em>
  have to acquire a <em class="emphatic">very</em>basic amount
  of notation reading skill</strong>.  But the extremely
  difficult task of honing your note reading skills that
  classical students are required to endure for years and years
  is <em class="emphatic">totally non-existant</em>as a
  requirement for playing non-classical piano.</li>
  • 是的,你可以学习如何弹钢琴而不必成为 伟大的符号读者, 但是,您将 必须获得非常基本的金额 记谱阅读技巧的提高。但是这个 磨练你的笔记阅读技能的艰巨任务 古典主义的学生需要忍受多年 完全不存在是吗 非古典钢琴演奏要求
  • 已应用命令填充段落(M-q)。我一辈子都搞不懂为什么在“reader”之后的第二行放一个换行符,因为这行有更多的空间可以放“however”。我注意到的另一件奇怪的事情是,当我删除并重新应用第4行和第5行的制表符(分别以“have”和“of”开头)时,两个空格字符也会自动插入,如下所示:

    <li>Yes, you can learn how to play piano without becoming a
      great notation reader,
      however, <strong class="warning">you <em class="emphatic">will</em>
        have to acquire a <em class="emphatic">very</em>basic amount
        of notation reading skill</strong>.  But the extremely
      difficult task of honing your note reading skills that
      classical students are required to endure for years and years
      is <em class="emphatic">totally non-existant</em>as a
      requirement for playing non-classical piano.</li>
    
  • 是的,你可以学习如何弹钢琴而不必成为 伟大的符号读者, 但是,您将 必须获得非常基本的金额 记谱阅读技巧的提高。但是这个 磨练你的笔记阅读技能的艰巨任务 古典主义的学生需要忍受多年 完全不存在是吗 非古典钢琴演奏要求
  • 我不知道这是不是什么线索。其他任何一行都不会发生这种情况

    这只是一个bug,还是有经验的Emacs人员知道这里可能发生了什么


    谢谢你

    在我看来像个虫子

    我可以把你的例子简化成这样:

    <li>blabla
      blabla <b>some_long_text_here</b> <b>more_long_text_here</b>
    
  • 布拉布拉 布拉布拉一些长长的文字在这里更多长长的文字在这里

  • 如果我从中删除一个字符的文本,
    填充段落
    将按预期工作。或者,如果我在两个消费性
    元素之间添加一个字符。

    这是有意的。以XML或SGML标记开头的行是段落分隔符行。如果Emacs以这样的方式打断了段落,即标记结束于一行的开头,则后续的
    fill paragration
    应用程序将在该行停止。这是为了确保,例如

    <p>a paragraph</p>
    <!-- no blank line -->
    <p>another paragraph</p>
    
    段落

    另一段

    不会变成

    <p>a paragraph</p> <!-- no blank line --> <p>another paragraph</p>
    
    一段

    另一段


    出于同样的原因,除非句点后有两个或两个以上的空格,否则Emacs不会在句点后断行,因为它使用双空格来区分以句子结尾的句点和以缩写结尾的句点,在缩写词结尾的句点后划掉一行会造成歧义。

    参见
    句子结尾双空格