[英]How can I insert empty lines into my org-mode agenda?
I am using org-mode to organize my tasks. 我正在使用组织模式来组织任务。 I use standard priorities.
我使用标准优先级。
Is it possible to insert empty lines into the standard agenda view? 是否可以在标准议程视图中插入空行? I have many tasks per day, and usually sort them by priority.
我每天有很多任务,通常按优先级排序。 The #A are shown on top, #B in the middle, #C at the bottom.
#A显示在顶部,#B显示在中间,#C显示在底部。
I would like to have an empty line as a separator after each priority class (one empty line after all the #A tasks, one empty line after all #B tasks, one empty line after the #C tasks). 我想在每个优先级类之后有一个空行作为分隔符(在所有#A任务之后为空行,在所有#B任务之后为空行,在#C任务之后为空行)。 This would make my agenda much more readable.
这将使我的议程更具可读性。
I do find help about how to insert dividers after blocks, but I do not use blocks. 我确实找到了有关如何在块后插入分隔符的帮助,但我没有使用块。
Thank you! 谢谢!
Here's a working solution from the code @lawlist provided in the comments. 这是注释中提供的@lawlist代码的有效解决方案。 It will visually delimit the current day's tasks based on priority
它将根据优先级在视觉上划定当天的任务
(defun my-custom-agenda-fn ()
(save-excursion
(let ((delimit "------------------------"))
(org-agenda-goto-today)
(dolist
(priority '("\\[#A\\]" "\\[#B\\]" "\\[#C\\]" "\\[#D\\]" "\\[#E\\]"))
(when (re-search-forward priority nil t)
(goto-char (point-at-bol)) (insert (concat delimit "\n"))))
(org-agenda-goto-today)
(when (re-search-forward delimit nil t)
(delete-region
(progn (forward-visible-line 0) (point))
(progn (forward-visible-line 1) (point))))
))
)
(add-hook 'org-agenda-finalize-hook 'my-custom-agenda-fn)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.