Using indent-rigidly.
This commit is contained in:
parent
549e045673
commit
e284080fca
@ -12,24 +12,10 @@
|
|||||||
|
|
||||||
(defun ghc-make-indent-shallower (beg end)
|
(defun ghc-make-indent-shallower (beg end)
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(let ((n ghc-indent-offset))
|
(indent-rigidly (region-beginning) (region-end) (- 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))))))
|
|
||||||
|
|
||||||
(defun ghc-make-indent-deeper (beg end)
|
(defun ghc-make-indent-deeper (beg end)
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(let ((indent (make-string ghc-indent-offset 32)))
|
(indent-rigidly (region-beginning) (region-end) ghc-indent-offset))
|
||||||
(save-excursion
|
|
||||||
(save-restriction
|
|
||||||
(narrow-to-region beg end)
|
|
||||||
(goto-char beg)
|
|
||||||
(while (not (eobp))
|
|
||||||
(insert indent)
|
|
||||||
(forward-line))))))
|
|
||||||
|
|
||||||
(provide 'ghc-indent)
|
(provide 'ghc-indent)
|
||||||
|
Loading…
Reference in New Issue
Block a user