From f55131f7458545903a2f9e9899d38e4363f35ec6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 6 Feb 2024 16:38:58 -0500 Subject: [PATCH] fix: early-init: expand string-remove-suffix Some builds of Emacs inexplicably fail to autoload subr-x at startup, meaning functions like string-remove-suffix are not guaranteed to be available. Rather than eagerly load the library too early, I opt for the safer option: to expand the single call into its lower level components. Ref: #7608 --- early-init.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/early-init.el b/early-init.el index a7fc58d29..a8438e050 100644 --- a/early-init.el +++ b/early-init.el @@ -84,7 +84,10 @@ (or (load (expand-file-name (format (let ((lfile (getenv-internal "DOOMPROFILELOADFILE"))) (if lfile - (concat (string-remove-suffix ".el" lfile) + (concat (let ((suffix ".el")) + (if (string-suffix-p suffix lfile) + (substring lfile 0 (- (length lfile) (length suffix))) + lfile)) ".%d.elc") "profiles/load.%d.elc")) emacs-major-version)