From 69323c24f11a333c4af730743f6ff204c64b0922 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 23 Apr 2019 17:01:11 -0400 Subject: util: Fix thinko Don't move point while trying to determine the bounds. --- lisp/km-util.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/km-util.el') 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) -- cgit v1.2.3