]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
emacs: add settings for Python modes 40758/head
authorJörg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 24 Feb 2026 17:08:30 +0000 (18:08 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 May 2026 17:51:41 +0000 (02:51 +0900)
Both python-mode and python-ts-mode are shipped by Emacs nowadays, with the
latter being the more modern tree-sitter-based one. Even though they are
similar, the newer one doesn't automatically take the older ones settings.

.dir-locals.el

index 6944406da07ba1448be45af54a960e2a51c33029..47da56f939021b74aa1c8f0eb78bc8fec6b878d1 100644 (file)
  (meson-mode . ((meson-indent-basic . 8)))
  (sh-mode . ((sh-indentation . 4)))
  (awk-mode . ((c-basic-offset . 8)))
+ (python-mode . ((indent-tabs-mode . nil)
+                 (tab-width . 4)
+                 (fill-column . 109)
+                 (python-indent-def-block-scale . 1)))
+ (python-ts-mode . ((indent-tabs-mode . nil)
+                    (tab-width . 4)
+                    (fill-column . 109)
+                    (python-indent-def-block-scale . 1)))
  (nil . ((indent-tabs-mode . nil)
          (tab-width . 8)
          (fill-column . 79))) )