Created
July 25, 2010 06:53
-
-
Save RTfXGaGeqSeItbMUgpFlekUs/489375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro smart-tabs-advice (function offset) | |
(defvaralias offset 'tab-width) | |
`(defadvice ,function (around smart-tabs activate) | |
(cond | |
(indent-tabs-mode | |
(save-excursion | |
(beginning-of-line) | |
(while (looking-at "\t*\\( +\\)\t+") | |
(replace-match "" nil nil nil 1))) | |
(setq tab-width tab-width) | |
(let ((tab-width fill-column) | |
(,offset fill-column)) | |
ad-do-it)) | |
(t | |
ad-do-it)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment