diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-01-31 02:06:18 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-01-31 02:06:18 -0500 |
commit | 9f093da7d183d7c568b7db90f2e5755cbb915b61 (patch) | |
tree | 49bdbc4e0eec504cf5ff988118011793e71ee617 /lisp/km-util.el | |
parent | f1ceb7344906070883cf24c47e48e913376e4974 (diff) | |
download | emacs.d-9f093da7d183d7c568b7db90f2e5755cbb915b61.tar.gz |
git-rebase: Add two fixup commands
Diffstat (limited to 'lisp/km-util.el')
-rw-r--r-- | lisp/km-util.el | 11 |
1 files changed, 11 insertions, 0 deletions
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 |