summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/km-util.el7
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)