diff options
author | Kyle Meyer <kyle@kyleam.com> | 2019-04-23 17:01:11 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2019-06-27 20:06:12 -0400 |
commit | 69323c24f11a333c4af730743f6ff204c64b0922 (patch) | |
tree | ba9c094fa3697d835becf2832561b0fd9b633683 | |
parent | 85a2182911eb350249727e319012d57ecf212744 (diff) | |
download | emacs.d-69323c24f11a333c4af730743f6ff204c64b0922.tar.gz |
util: Fix thinko
Don't move point while trying to determine the bounds.
-rw-r--r-- | lisp/km-util.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/km-util.el b/lisp/km-util.el index 0ddcb06..211ac35 100644 --- a/lisp/km-util.el +++ b/lisp/km-util.el @@ -41,8 +41,11 @@ 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)))) + (let ((beg (region-beginning)) + (end (region-end))) + (save-excursion + (list (progn (goto-char beg) (point-at-bol)) + (progn (goto-char end) (1+ (point-at-eol)))))) (list (point-min) (point-max)))) (defun km/open-github-patch (buffer) |