簡體   English   中英

Emacs:自動填充模式怪異的壓痕行為

[英]Emacs: auto-fill-mode weird indentation behaviour

目前,我正在從auto-fill-mode派生的主要模式下工作,在該模式下,我需要以特殊的縮進方式顯示文本(這是screenwriter.el項目的衍生版本),而我只是被困於有多行縮進時自動填充:

(注意:use-hard-newlines為nil,左邊距為0):

我希望它如何工作:

         DUDE           <-- here I insert a newline
     (sad)              <-- here I insert another newline 
Hello, look how good    <-- here I let the auto-fill-mode fill the text automatically
of a day it is!

但是會發生以下情況:

         DUDE           <-- here I insert a newline
     (sad)              <-- here I insert another newline 
Hello, look how good    <-- here I let the auto-fill-mode fill the text automatically
     of a day it is!

因此,當有多個縮進的段落(縮進第二行的左邊界)時,基本上填充模式會產生奇怪的作用。 我在任何地方都找不到如何避免這種行為的方法。

甚至更陌生,以下代碼也可以正常工作,但要縮進前行的邊距。

         DUDE           <-- here I insert a newline
Hello, look how good    <-- here I let the auto-fill-mode fill the text automatically
of a day it is!

我想知道這是否只是一個錯誤,或者是否有避免這種情況的方法,因為這很煩人。 任何人都可以測試它在其他版本的emacs上是否有不同的工作方式,或者至少給我提示如何解決此問題的方法嗎? 非常感謝你。

Emacs版本:Windows上的24.3.1

編輯:我剛剛檢查並使用use-hard-newlines發生相同的行為,所以我忘了如何解決此問題

您可以自定義adaptive-fill-mode變量,這是導致在填充文本時自動確定前綴的原因。 將變量設置為nil可禁用該行為。

有關如何計算前綴的詳細信息,請參見fill-context-prefix函數。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM