From 52355c6131fdddea578bf3de737a46c60852a127 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 9 Feb 2024 00:25:05 -0500 Subject: [PATCH] fix(org): initialize eldoc in org-mode buffers A recent change upstream (see emacsmirror/org-contrib@6e208c87bf6e) removed the autoload for adding org-eldoc-load to org-mode-hook, so we have to add the hook ourselves (the function is still autoloaded, fortunately). Also moves org-eldoc config into its own use-package! block. Fix: #7633 Ref: emacsmirror/org-contrib@6e208c87bf6e --- modules/lang/org/config.el | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index c0606dec4..087f95cf6 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -105,7 +105,6 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default (defun +org-init-appearance-h () "Configures the UI for `org-mode'." (setq org-indirect-buffer-display 'current-window - org-eldoc-breadcrumb-separator " → " org-enforce-todo-dependencies t org-entities-user '(("flat" "\\flat" nil "" "" "266D" "♭") @@ -814,14 +813,6 @@ Unlike showNlevels, this will also unfold parent trees." :weight bold)))) (apply fn args))) - (after! org-eldoc - ;; HACK Fix #2972: infinite recursion when eldoc kicks in in 'org' or - ;; 'python' src blocks. - ;; TODO Should be reported upstream! - (puthash "org" #'ignore org-eldoc-local-functions-cache) - (puthash "plantuml" #'ignore org-eldoc-local-functions-cache) - (puthash "python" #'python-eldoc-function org-eldoc-local-functions-cache)) - (defun +org--restart-mode-h () "Restart `org-mode', but only once." (quiet! (org-mode-restart)) @@ -1194,6 +1185,20 @@ between the two." (add-hook 'kill-emacs-hook #'org-clock-save)) +(use-package! org-eldoc + ;; HACK: Fix #7633: this hook is no longer autoloaded by org-eldoc (in + ;; org-contrib), so we have to add it ourselves. + :hook (org-mode . org-eldoc-load) + :init (setq org-eldoc-breadcrumb-separator " → ") + :config + ;; HACK Fix #2972: infinite recursion when eldoc kicks in in 'org' or 'python' + ;; src blocks. + ;; TODO Should be reported upstream! + (puthash "org" #'ignore org-eldoc-local-functions-cache) + (puthash "plantuml" #'ignore org-eldoc-local-functions-cache) + (puthash "python" #'python-eldoc-function org-eldoc-local-functions-cache)) + + (use-package! org-pdftools :when (modulep! :tools pdf) :commands org-pdftools-export