From 9f093da7d183d7c568b7db90f2e5755cbb915b61 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 31 Jan 2016 02:06:18 -0500 Subject: git-rebase: Add two fixup commands --- lisp/km-util.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lisp/km-util.el') diff --git a/lisp/km-util.el b/lisp/km-util.el index 8957862..40672d7 100644 --- a/lisp/km-util.el +++ b/lisp/km-util.el @@ -34,5 +34,16 @@ (--filter (with-current-buffer it (derived-mode-p mode)) (buffer-list))) +(defun km/region-or-buffer-line-bounds () + "Return line bounds for region. +If region is active, return postions that mark the beginning of +the first line and end of the last line that the region touches. +If there is no active region, return a the minimum and maximum +point in the buffer." + (if (use-region-p) + (list (progn (goto-char (region-beginning)) (point-at-bol)) + (progn (goto-char (region-end)) (1+ (point-at-eol)))) + (list (point-min) (point-max)))) + (provide 'km-util) ;;; km-util.el ends here -- cgit v1.2.3