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
parent 5c3b820335
commit f55131f745
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

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)