summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck.cuny@gmail.com>2019-02-16 18:09:34 -0800
committerfranck cuny <franck.cuny@gmail.com>2019-02-16 18:09:34 -0800
commitea700cbf750a98327f525e0a5a4934efdf2c9885 (patch)
treea61ee41d001643a820201deb5778ed750e7a0062
parentCreate a group for pants settings. (diff)
downloadpants.el-ea700cbf750a98327f525e0a5a4934efdf2c9885.tar.gz
Add a mode for setting the indentation.
For BUILD file, the indentation is set to 4.
-rw-r--r--pants.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/pants.el b/pants.el
index 1809966..4deabe4 100644
--- a/pants.el
+++ b/pants.el
@@ -64,6 +64,13 @@
 
 (defvar *pants-compilation-buffer* "*pants-compilation-buffer*")
 
+(define-derived-mode pants-build-mode python-mode "Pants"
+  "Major mode for editing Pants build files."
+  :group 'pants
+
+  (setq-local python-indent-guess-indent-offset nil)
+  (setq-local python-indent-offset 4))
+
 (defun pants--find-directory-containing-build-file (file)
   "Finds the directory containing the build file next to a give file."
   (let ((root nil)