请教 org-mode 列表中实现类似 word 中的悬挂缩进

在 org-mode 的列表中,在下图的 panel 后面,

直接按回车,缩进通常是这样的

强迫症患者表示很想把默认回车后,org-mode 列表的缩进修改为这样

让第一行的参和第二行的里对齐上,请问有没有什么配置项或者函数可以做到呢?

多谢 :slight_smile:

Screen Shot 2021-09-07 at 09.35.38 是因为你用了那个方框的原因?

多谢回复,那个方框就是一个 org-mode 默认的 checkbox,

文本就是 - [ ] 这样的

是设置了显示成一个方框

我尝试了下,取消这个配置,直接显示成 - [ ] 发现文字还是和 [ ] 对齐了,没有文字和文字对齐

找到一个邮件列表 thread 讨论这个问题的,貌似默认的没有设置

https://orgmode.org/list/[email protected]/T/

有没有有可能修改下 fill-paragraph 忽略前面的 - [ ] 部分进行格式化,格式化完了再把 - [ ] 加回来呢

(defun org-return@fix-checklist-indent (orig-fn &rest rest)
  "Advice around `org-return' to fix indent of checklist."
  (let* ((context (org-element-property :parent (org-element-context)))
         (column (if (and context
                          (org-element-property :bullet context)
                          (org-element-property :checkbox context))
                     (1- (org-element-property :contents-begin context)))))
    (if column
        (progn
          (newline)
          (indent-to column))
      (apply orig-fn rest))))

(advice-add 'org-return :around #'org-return@fix-checklist-indent)
2 个赞