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)
This commit is contained in:
parent
2b7655ca0e
commit
ee6bdd6eef
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue