org--agenda-prefix-format %? does not work

戏子无情 提交于 2019-12-03 21:20:02

The problem is that the field is never empty: it will always contain at least the left and right square brackets plus the white space to bring it to a width of 12.

The solution is to write a function that returns either an empty string or the bracketed project and use that in the format:

  (defun foo ()
     (let ((x (nth 1 (org-get-outline-path))))
       (if x
           (concat "[ " (org-format-outline-path (list x)) " ]")
         "")))

  (setq org-agenda-prefix-format " %i %?-12(foo) "
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!