【问题标题】:File-local variables in `org-mode``org-mode` 中的文件局部变量
【发布时间】:2021-04-16 18:22:22
【问题描述】:

我在 org-mode 文件中设置了以下变量:

* conf
# local variables:
# org-agenda-start-on-weekday: 1
# org-clock-report-include-clocking-task: t
# org-duration-format: (quote h:mm) #fails
# end:

除了org-duration-format,它们都工作得很好。我做错了什么?

(我说它不起作用,因为我必须运行 (setq org-duration-format 'h:mm) 才能获得我喜欢的格式。

【问题讨论】:

    标签: emacs org-mode


    【解决方案1】:

    emacs 手册 (C-h i g (emacs) specifying file variables RET) 的文件本地变量部分说:

    局部变量列表中的变量是按字面意思使用的,而不是首先计算的。

    所以只需按字面意思使用h:mm

    ...
    # org-duration-format: h:mm
    ...
    

    你也可以这样做:

    ...
    # eval: (setq-local org-duration-format 'h:mmm)
    ...
    

    但实际上没有必要这样做。

    顺便说一句,这与 Org 模式无关。试试

    # Local Variables:
    # bar: 3
    # foo: bar
    # End:
    

    bar 的文件本地值为 3; foo 的文件本地值是 barbarNOT 评估的,所以 foo 确实 NOT 以值 3 结束。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-13
      • 1970-01-01
      • 1970-01-01
      • 2014-03-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多