From 7197ee65c7cd1a8291266a3514583406e1ab1f18 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 30 Aug 2024 02:24:11 -0400 Subject: [PATCH] fix: help(ful) reporting symbol's source as init.*.el Fix: #7958 --- lisp/doom-start.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/doom-start.el b/lisp/doom-start.el index 35a4f2e9e..8e06d729d 100644 --- a/lisp/doom-start.el +++ b/lisp/doom-start.el @@ -394,7 +394,15 @@ If RETURN-P, return the message as a string instead of displaying it." ;; the next file it loads into `user-init-file'. (setq user-init-file t) (when init-file-name - (load init-file-name 'noerror 'nomessage 'nosuffix)) + (load init-file-name 'noerror 'nomessage 'nosuffix) + ;; HACK: if `init-file-name' happens to be higher in + ;; `load-history' than a symbol's actual definition, + ;; `symbol-file' (and help/helpful buffers) will report the + ;; source of a symbol as `init-file-name', rather than it's + ;; true source. By removing this file from `load-history', no + ;; one will make that mistake. + (setq load-history (delete (assoc init-file-name load-history) + load-history))) ;; If it's still `t', then it failed to load the profile initfile. ;; This likely means the user has forgotten to run `doom sync'! (when (eq user-init-file t)