From: Eli Zaretskii Date: Thu, 21 Oct 2021 19:13:09 +0000 (+0300) Subject: Fix non-interactive behavior of 'kill-region' X-Git-Tag: emacs-28.0.90~223 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee6bdd6eef329434427c6a7b22613bd33249d00a;p=emacs.git Fix non-interactive behavior of 'kill-region' * lisp/simple.el (kill-region): Actually ignore BEG and END when REGION is non-nil. Doc fix. (Bug#51320) --- diff --git a/lisp/simple.el b/lisp/simple.el index bec4aa4738e..4aa373d6701 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5285,11 +5285,12 @@ Lisp programs should use this function for killing text. Supply two arguments, character positions BEG and END indicating the stretch of text to be killed. If the optional argument REGION is non-nil, the function ignores BEG and END, and kills the current - region instead." + region instead. Interactively, REGION is always non-nil, and so + 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 (and beg end) + (unless (or region (and beg end)) (user-error "The mark is not set now, so there is no region")) (condition-case nil (let ((string (if region