branch: elpa/crux
commit ad42bcf77b588539386be8fbacd952efc9f887fd
Author: Carlo Sciolla <carlo.scio...@gmail.com>
Commit: Bozhidar Batsov <bozhidar.bat...@gmail.com>

    Support make `crux-cleanup-buffer-or-region` support makefiles
    
    Tabs are not equivalent to spaces in Makefiles
---
 crux.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/crux.el b/crux.el
index 9fe00f2..3ed126d 100644
--- a/crux.el
+++ b/crux.el
@@ -51,6 +51,12 @@
   :type 'list
   :group 'crux)
 
+(defcustom crux-untabify-sensitive-modes
+  '(makefile-bsdmake-mode)
+  "Modes for which untabify is suppressed."
+  :type 'list
+  :group 'crux)
+
 (defcustom crux-shell (getenv "SHELL")
   "The default shell to run with `crux-visit-term-buffer'."
   :type 'string
@@ -312,7 +318,8 @@ point reaches the beginning or end of the buffer, stop 
there."
 (defun crux-cleanup-buffer-or-region ()
   "Cleanup a region if selected, otherwise the whole buffer."
   (interactive)
-  (call-interactively #'untabify)
+  (unless (member major-mode crux-untabify-sensitive-modes)
+    (call-interactively #'untabify))
   (unless (member major-mode crux-indent-sensitive-modes)
     (call-interactively #'indent-region))
   (whitespace-cleanup))

Reply via email to