mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-04-19 11:22:07 -07:00
fix(lib): doom-set-indent: handling nil or undefined vars
When indent variables registered with `set-indent-vars!` aren't defined or are nil when `doom-set-indent` is called. Fix: #8730 Amend:5e290e8e79Amend:c0662f6ea1
This commit is contained in:
parent
ed67d0dde3
commit
eb40bec314
1 changed files with 5 additions and 1 deletions
|
|
@ -61,7 +61,11 @@ with `set-indent-vars!'."
|
|||
(defun doom-set-indent (&optional width)
|
||||
"Ensure tab-width reflects the local major mode's indent variable."
|
||||
(when-let* ((vars (doom-indent-vars-for-mode major-mode))
|
||||
(width* (or width (cl-some #'symbol-value vars))))
|
||||
(width* (or width
|
||||
(cl-loop for v in vars
|
||||
if (boundp v)
|
||||
if (symbol-value v)
|
||||
return it))))
|
||||
(doom-log 2 "doom-set-indent: %S = %S" `(tab-width standard-indent ,@vars) width*)
|
||||
(setq-local tab-width width*
|
||||
standard-indent width*)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue