fix(lib): provided-mode-derived-p calls on Emacs <=29

This function's signature changed in 30.1:

Before: (mode &rest modes)
After:  (mode &optional modes &rest old-modes)

So use forms that are forwards compatible with its new signature.

Fix: #8721
This commit is contained in:
Henrik Lissner 2026-03-24 02:14:43 -04:00
parent dd1e25279d
commit ba511fcbfb
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 5 additions and 4 deletions

View file

@ -94,7 +94,8 @@ If CONSIDER-MODE? is non-nil, returns non-nil if BUF's mode is derived from
`special-mode'."
(or (char-equal ?* (aref (buffer-name buf) 0))
(and consider-mode?
(provided-mode-derived-p (buffer-local-value 'major-mode buf) 'special-mode))))
(provided-mode-derived-p (buffer-local-value 'major-mode buf)
'special-mode))))
;;;###autoload
(defun doom-temp-buffer-p (buf)
@ -150,8 +151,8 @@ If BUFFER-OR-NAME is omitted or nil, the current buffer is tested."
(and (buffer-live-p buf)
(not (doom-temp-buffer-p buf))
(or (buffer-local-value 'doom-real-buffer-p buf)
(provided-mode-derived-p (buffer-local-value 'major-mode buf)
doom-real-buffer-modes)
(apply #'provided-mode-derived-p (buffer-local-value 'major-mode buf)
doom-real-buffer-modes)
(run-hook-with-args-until-success 'doom-real-buffer-functions buf)
(not (run-hook-with-args-until-success 'doom-unreal-buffer-functions buf))))))

View file

@ -30,7 +30,7 @@ MODE-tab-width, or MODE-basic-offset. It is also not necessary if you have
Modes for whom this fails need to have their indent vars manually registered
with `set-indent-vars!'."
(unless (provided-mode-derived-p mode doom-indent-excluded-modes)
(unless (apply #'provided-mode-derived-p mode doom-indent-excluded-modes)
(let* ((mode* (symbol-name mode))
(mode** (cl-loop for s in '("-mode" "-base" "-ts")
do (setq mode* (string-remove-suffix s mode*))