Open utterances-bot opened 3 years ago
Thx for your awesome series on org-mode and roam. Helps me a lot tweaking my setup and provides great inspiration.
Hey @BitSchupser
I am glad you find it useful! Thank you for reaching me out :) Please let me know if you have any troubles with examples in theses posts.
Fantastic @d12frosted! I am truly standing on the shoulders of giants with this.
Thanks for this set of articles @d12frosted! It's helped me with a short term problem of setting up a GTD workflow within the org-roam paradigm, and more importantly - pushed me to dig further into my elisp.
One small typo in your final codeblock with the s.el
optimization:
(setq org-agenda-prefix-format
'((agenda . " %i %(vulpea-agenda-category 12)%?-12t% s")
(todo . " %i %(vulpea-agenda-category 12) ")
(tags . " %i %(vulpea-agenda-category 12) ")
(search . " %i %(vaulpea-agenda-category 12) "))) ;; This should be vulpea, not vaulpea
@d4ncer thanks! fixed typo in master, should be GAed soon.
I'm using the whole package and I want to say THANK YOU, my agenda is fast, I can navigate / search easily and my workflow improved. I rely heavily on zettelkasten / roam so this has been the perfect solution to bring everything together.
@cjbarroso great to hear 🙃 enjoy your fast note taking system!
Thanks for writing such an amazing guide, it's really helpful!
There is a small problem when using the vulpea-agenda-category
function. When opening the agenda view, the following warning appears:
⛔ Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode)
In addition, lines without tasks will display "???" (which is returned by org-get-category
)
??? 16:00...... -----------------------------------------------------
??? 18:00...... -----------------------------------------------------
??? 20:00...... -----------------------------------------------------
The solution is to add a file buffer check when assigning category
variable, as the warning originates from org-element-at-point
, which is caused by org-get-category
@@ -22,7 +22,7 @@
(file-name-sans-extension
(file-name-nondirectory buffer-file-name))))
(title (vulpea-buffer-prop-get "title"))
- (category (org-get-category))
+ (category (when buffer-file-name (org-get-category)))
(result
(or (if (and
title
@Cycatz glad to hear you find it helpful 🙏
There is a small problem when using the vulpea-agenda-category function. When opening the agenda view, the following warning appears:
Aaaah, I completely forgot about log mode, which actually calls vulpea-agenda-category
outside org mode buffer. Even title
should not be calculated in such cases! You fix does the trick, but you can avoid any unnecessary calculations like this:
(defun vulpea-agenda-category (&optional len)
"Get category of item at point for agenda.
Category is defined by one of the following items:
- CATEGORY property
- TITLE keyword
- TITLE property
- filename without directory and extension
When LEN is a number, resulting string is padded right with
spaces and then truncated with ... on the right if result is
longer than LEN.
Usage example:
(setq org-agenda-prefix-format
\\='((agenda . \" %(vulpea-agenda-category) %?-12t %12s\")))
Refer to `org-agenda-prefix-format' for more information."
(if (eq major-mode 'org-mode)
(let* ((file-name (when buffer-file-name
(file-name-sans-extension
(file-name-nondirectory buffer-file-name))))
(title (vulpea-buffer-prop-get "title"))
(category (org-get-category))
(result
(or (if (and
title
(string-equal category file-name))
title
category)
"")))
(if (numberp len)
(s-truncate len (s-pad-right len " " result))
result))
(s-repeat (or len 0) " ")))
@d12frosted You're absolutely right! Much appreciated!
Task management with org-roam Vol. 2: Categories
Automatic category extraction from org-roam
https://d12frosted.io/posts/2020-06-24-task-management-with-roam-vol2.html