summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d
diff options
context:
space:
mode:
authorAlan Pearce2015-08-31 10:17:47 +0200
committerAlan Pearce2015-08-31 10:17:47 +0200
commit4d21cdf99136d0280cb2af57613295255f20a910 (patch)
treeb610377354af6612df051fa77824dc75afdc22f2 /tag-emacs/emacs.d
parent978b10831437e0217d2c770ac88272ba1a1c4dc4 (diff)
downloaddotfiles-4d21cdf99136d0280cb2af57613295255f20a910.tar.lz
dotfiles-4d21cdf99136d0280cb2af57613295255f20a910.tar.zst
dotfiles-4d21cdf99136d0280cb2af57613295255f20a910.zip
Emacs: Fix smart-tabs-mode by brute force
Not really sure what’s wrong with the initialisation, but now it works.
Diffstat (limited to 'tag-emacs/emacs.d')
-rw-r--r--tag-emacs/emacs.d/init.org24
1 files changed, 20 insertions, 4 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 023de0a..1498f25 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -614,12 +614,28 @@ with spaces.  Perfect!
 
 #+BEGIN_SRC emacs-lisp
   (req-package smart-tabs-mode
-    :commands (smart-tabs-mode
-               smart-tabs-mode-enable
-               smart-tabs-advice)
+    :defer 1
     :config (progn
-              (smart-tabs-insinuate 'c 'javascript 'cperl 'python))
+              (smart-tabs-mode/no-tabs-mode-advice align)
+              (smart-tabs-mode/no-tabs-mode-advice align-regexp)
+              (smart-tabs-mode/no-tabs-mode-advice indent-relative)
+              (smart-tabs-mode/no-tabs-mode-advice comment-dwim)
+              (smart-tabs-mode/no-tabs-mode-advice comment-box)
+              (smart-tabs-mode/no-tabs-mode-advice comment-indent)
+
+              (unless
+                  (ad-find-advice 'indent-according-to-mode 'around 'smart-tabs)
+                (defadvice indent-according-to-mode (around smart-tabs activate)
+                  (if smart-tabs-mode
+                      (let ((indent-tabs-mode indent-tabs-mode))
+                        (if (memq indent-line-function
+                                  '(indent-relative
+                                    indent-relative-maybe))
+                            (setq indent-tabs-mode nil))
+                        ad-do-it)
+                    ad-do-it))))
     :init (progn
+            (smart-tabs-insinuate 'c 'cperl 'javascript 'python)
             (add-hook 'php-mode-hook (lambda ()
                                        (smart-tabs-mode indent-tabs-mode)))))
 #+END_SRC