From 4d21cdf99136d0280cb2af57613295255f20a910 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 31 Aug 2015 10:17:47 +0200 Subject: Emacs: Fix smart-tabs-mode by brute force Not really sure what’s wrong with the initialisation, but now it works. --- tag-emacs/emacs.d/init.org | 24 ++++++++++++++++++++---- 1 file 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 -- cgit 1.4.1