]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
python mode trailing whitespaces
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 10 Feb 2026 14:45:27 +0000 (15:45 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 10 Feb 2026 14:45:27 +0000 (15:45 +0100)
* bba.org: delete trailing whitespaces in python mode

bba.org

diff --git a/bba.org b/bba.org
index efb1ff6393f6e69f44324e7d35620e9dffb6d22e..a29a12db17c15a64bdf41d8448a6b6f652385241 100644 (file)
--- a/bba.org
+++ b/bba.org
@@ -1658,6 +1658,12 @@ like these:
                                                         (save-excursion
                                                           (delete-trailing-whitespace))))))))
 
+  (eval-after-load "python-mode"
+    '(add-hook 'python-mode-hook (lambda() (add-hook 'write-contents-functions
+                                                   (lambda()
+                                                      (unless (boundp 'bba-keep-whitespaces)
+                                                        (save-excursion
+                                                          (delete-trailing-whitespace))))))))
   (eval-after-load "text-mode"
     '(add-hook 'text-mode-hook (lambda() (add-hook 'write-contents-functions
                                                    (lambda()