Created
August 22, 2017 12:32
-
-
Save tek-nishi/fa477e2f1f42d38e5bec4a26edc9df76 to your computer and use it in GitHub Desktop.
If mark-active, then indent-region. else mark-defun and indent-region.
This file contains hidden or 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 my-indent (&optional beg end) | |
"リージョンが有効ならその範囲をインデント\nそうでないなら関数内をインデント" | |
(interactive "r") | |
(if mark-active | |
(indent-region beg end) | |
(save-excursion | |
(mark-defun) | |
(indent-region (region-beginning) (region-end))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment