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
This commit is contained in:
Henrik Lissner 2024-02-06 16:38:58 -05:00 committed by Yann Esposito (Yogsototh)
parent db039b4d1c
commit 1ef759989a
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -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)