Skip to content

Commit

Permalink
Fix indent inference where lisp-indent-offset goes wrong in lisp-modes
Browse files Browse the repository at this point in the history
When an indent-spec in `editorconfig-indentation-alist` is a function, it points to an indent setter which should not be called.

This fixes the problem in lisp-modes where `lisp-indent-offset` is unwantedly set to 8.

Closes #327.
  • Loading branch information
knu committed Jul 24, 2024
1 parent eedd881 commit b093e54
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions copilot.el
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ find indentation offset."
:type 'boolean)

(defcustom copilot-indentation-alist
(append '((latex-mode tex-indent-basic)
(append '((emacs-lisp-mode lisp-indent-offset)
(latex-mode tex-indent-basic)
(lisp-mode lisp-indent-offset)
(nxml-mode nxml-child-indent)
(python-mode python-indent py-indent-offset python-indent-offset)
(python-ts-mode python-indent py-indent-offset python-indent-offset)
Expand Down Expand Up @@ -477,10 +479,7 @@ automatically, browse to %s." user-code verification-uri))
(symbol-value s))))
indent-spec))
((functionp indent-spec) ; editorconfig 0.11.0+
(cl-some (lambda (pair)
(when (numberp (cdr pair))
(cdr pair)))
(funcall indent-spec tab-width)))))))
;; This points to a setter, which do not call)))))
(progn
(when (and
(not copilot-indent-offset-warning-disable)
Expand Down

0 comments on commit b093e54

Please sign in to comment.