From 02bbdde2d2a5fafcfcb10bf1d8b10f4c0cb1a1a5 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Wed, 14 Aug 2024 05:08:03 -0400 Subject: [PATCH] fix(org): compatibility issues --- config.org | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/config.org b/config.org index 30ac3c0..97efc29 100644 --- a/config.org +++ b/config.org @@ -3160,9 +3160,8 @@ Inline images in Org are file links pointing to images without a description. Us (defadvice! +org-inline-desc (old-fn protocol link description) "Disable inline images with descriptions when `+org-inline-image-desc' is non-nil." - :around '(org-yt-image-data-fun - +org-inline-image-data-fn - +org-http-image-data-fn) + :around (list #'+org-inline-image-data-fn + #'+org-http-image-data-fn) (when (or +org-inline-image-desc (null description)) (funcall old-fn protocol link description))) #+end_src @@ -3294,19 +3293,17 @@ Annoyingly, the only good way to fix these issues is to completely override the When an explicit category is not specified, Org mode typically defaults to the filename (sans extension). This ... sort of makes sense? I guess? It doesn't really, because filename conventions don't make for good agenda category names. I want my category names to be in title case, whereas a file name is typically going to be all lowercase and without spaces. This is especially bad for Org-roam, where filenames are automatically generated and way too long to be a UI element. -To fix this issue, it's... "easy" to patch Org-mode's category system[fn:2]. The following code sets things up so that the file's =#+title= metadata is used as the default category, falling back on the default behavior if a title is not given. +To fix this issue, it's... "easy" to patch Org-mode's category system. The following code sets things up so that the file's =#+title= metadata is used as the default category, falling back on the default behavior if a title is not given. #+begin_src emacs-lisp (defadvice! ~/org-default-category (old-fn) "Modify how Org resolves the default category through the `org-category' variable." - :around '(org-refresh-category-properties org-element-org-data-parser) + :around #'org-element--get-category (let ((org-category (or org-category (org-get-title)))) (funcall old-fn))) #+end_src -[fn:2] It took me multiple hours of combing through Org's source code in order to find the multiple places(???) where this behavior was implemented and to figure out how to modify it. At least the final code is short! - ** Org Roam #+call: confpkg("Org: Roam")