; * lisp/simple.el (kill-region): A better fix for bug#51320.

This commit is contained in:
Eli Zaretskii 2021-10-21 22:29:37 +03:00
parent ee6bdd6eef
commit 5bc522b4f4

View file

@ -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)