My global tab-width
is set to 4. But in elisp-mode I get 6 spaces per tab in indentation. So the code after auto indenting looks like this:
(defun new-eshell ()
(interactive)
(when (one-window-on-screen-p)
(let* ((lines (window-body-height))
(new-window (split-window-vertically (floor (* 0.7 lines)))))
(select-window new-window)
(buffer-name (eshell "eshell"))
)))
How can I set the indentation to 2 spaces?
Update: info for NickD
After I type C-h m
I get this:
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Cl-Old-Struct-Compat Delete-Selection Diff-Auto-Refine Display-Time
Eldoc Electric-Indent File-Name-Shadow Font-Lock Global-Eldoc
Global-Font-Lock Global-Undo-Tree Ivy Line-Number Menu-Bar Mouse-Wheel
Override-Global Pyvenv Shell-Dirtrack Tooltip Transient-Mark Undo-Tree
Yas Yas-Global
(Information about these minor modes follows the major mode info.)
Emacs-Lisp mode defined in ‘elisp-mode.el’:
Major mode for editing Lisp code to run in Emacs.
Doing the same in emacs -Q
gives 2 spaces. So, something is wrong with the configs.
C-h v lisp-body-indent RET
say?TAB
s or are you letting the mode decide the indentation?