Using indent-rigidly.

This commit is contained in:
Kazu Yamamoto 2012-08-10 09:21:09 +09:00
parent 549e045673
commit e284080fca

View File

@ -12,24 +12,10 @@
(defun ghc-make-indent-shallower (beg end)
(interactive "r")
(let ((n ghc-indent-offset))
(save-excursion
(save-restriction
(narrow-to-region beg end)
(goto-char beg)
(while (not (eobp))
(delete-region (point) (+ (point) n))
(forward-line))))))
(indent-rigidly (region-beginning) (region-end) (- ghc-indent-offset)))
(defun ghc-make-indent-deeper (beg end)
(interactive "r")
(let ((indent (make-string ghc-indent-offset 32)))
(save-excursion
(save-restriction
(narrow-to-region beg end)
(goto-char beg)
(while (not (eobp))
(insert indent)
(forward-line))))))
(indent-rigidly (region-beginning) (region-end) ghc-indent-offset))
(provide 'ghc-indent)