Created
September 26, 2012 19:34
-
-
Save fakedrake/3790068 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
(defun py-my-indent-region (&optional min max) | |
"Stupidly clamp indentation to the closest multiple of 4 spaces." | |
(interactive) | |
(save-excursion | |
(let ((top (or min (point-min))) | |
(bottom (or max (point-max))) | |
(line-move-visual nil)) | |
(goto-char top) | |
(while (<= (point) bottom) | |
(indent-line-to | |
(* 4 (round (/ (float (current-indentation)) 4)))) | |
(next-line) (end-of-line))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment