使用 org-indent-mode 时如何用适当的缩进包装列表?

Posted

技术标签:

【中文标题】使用 org-indent-mode 时如何用适当的缩进包装列表?【英文标题】:How to wrap lists with proper indentation when using org-indent-mode? 【发布时间】:2012-01-19 13:42:41 【问题描述】:

在 Org 模式下,我可以使用适当的缩进 by using org-indent-mode 来换行标题。我怎样才能对列表做同样的事情,也就是说,我怎样才能让 Org-mode 中的列表以适当的缩进换行?

如果我插入

* Very very very very very very very very very very very very very very very very very very very long line
- Very very very very very very very very very very very very very very very very very very very long line

使用org-indent-mode 进入组织模式缓冲区,我得到以下信息:

* Very very very very very very very very very very very very very very very
  very very very very long line
  - Very very very very very very very very very very very very very very very
  very very very very long line.

请注意,列表的第二行(以- 开头的行)没有正确缩进,因为它应该与列表开头的第一个字母对齐。我期望的是:

* Very very very very very very very very very very very very very very very
  very very very very long line
  - Very very very very very very very very very very very very very very very
    very very very very long line.

我在 GNU Emacs 23.3.1 中运行 Org-mode 7.6。

【问题讨论】:

【参考方案1】:

现在这似乎是Org-mode version 7.8.03 中的标准。 7.8 版本的消息称,org-ident.el 已被重构以在与视觉线模式一起使用时进行一些改进(并且应该更快)。

作为测试,我运行了 emacs -q 并使用了 emacs24 附带的 Org-mode version 7.7。它显示了不良行为。将我的 7.8 本地副本添加到我的加载路径并重新加载 org 然后刷新缓冲区 C-c C-c on:

#+STARTUP: indent

在附加行上添加了额外的空格,以便缩进符合您的预期。

升级到 7.8.03(或当前的 git-head)将为您提供所需的功能。


测试结果

组织模式 7.7

#+STARTUP: indent

* Very very very very very very very very very very very
very very very very very very very very long line
  - Very very very very very very very very very very very
  very very very very very very very very long line.

组织模式 7.8.03

#+STARTUP: indent

* Very very very very very very very very very very very 
  very very very very very very very very long line
  - Very very very very very very very very very very very
    very very very very very very very very long line.

【讨论】:

很高兴听到这个消息。是否可以通过一些小技巧将此功能合并到 Org-mode 7.6 中? 我不知道。您可能会更幸运地在邮件列表中提出这个问题,或者将 7.8 中的 org-indent.el 与 7.6 中的进行比较。但是,您有什么特别的原因不想升级吗? 我使用的是 Ubuntu 存储库中的版本,如果有一些小改动,使用它会比手动更新 Org-mode 更容易。

以上是关于使用 org-indent-mode 时如何用适当的缩进包装列表?的主要内容,如果未能解决你的问题,请参考以下文章

使用产品结账时如何用 laravel + cashier 生成发票

保存时如何用计数命名文件?

使用Webflux和Spring Cloud时如何用netty替换tomcat?

聚焦时如何用图像填充 LWUIT 按钮?

操作列时如何用熊猫数据框处理“除以零”? [复制]

在c#中写入文件时如何用变量显示双引号? [复制]