all repos — nixfiles @ 4d21cdf99136d0280cb2af57613295255f20a910

System and user configuration, managed by nix and home-manager

Emacs: Fix smart-tabs-mode by brute force Not really sure what’s wrong with the initialisation, but now it works.

Alan Pearce
commit

4d21cdf99136d0280cb2af57613295255f20a910

parent

978b10831437e0217d2c770ac88272ba1a1c4dc4

1 file changed, 20 insertions(+), 4 deletions(-)

jump to
M tag-emacs/emacs.d/init.orgtag-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