summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2021-10-21 22:29:37 +0300
committerEli Zaretskii <eliz@gnu.org>2021-10-21 22:29:37 +0300
commit5bc522b4f45f17c44449a05df562d8f0ae00bcb4 (patch)
treedbc28bc300066a0d46a5dde8b98d47a336be87b7 /lisp
parentee6bdd6eef329434427c6a7b22613bd33249d00a (diff)
downloademacs-5bc522b4f45f17c44449a05df562d8f0ae00bcb4.tar.gz
emacs-5bc522b4f45f17c44449a05df562d8f0ae00bcb4.tar.bz2
emacs-5bc522b4f45f17c44449a05df562d8f0ae00bcb4.zip
; * lisp/simple.el (kill-region): A better fix for bug#51320.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/simple.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 4aa373d6701..e3657cc079e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5289,9 +5289,12 @@ Supply two arguments, character positions BEG and END indicating the
this command always kills the current region."
;; Pass mark first, then point, because the order matters when
;; calling `kill-append'.
- (interactive (list (mark) (point) 'region))
- (unless (or region (and beg end))
- (user-error "The mark is not set now, so there is no region"))
+ (interactive (progn
+ (let ((beg (mark))
+ (end (point)))
+ (unless (and beg end)
+ (user-error "The mark is not set now, so there is no region"))
+ (list beg end 'region))))
(condition-case nil
(let ((string (if region
(funcall region-extract-function 'delete)