Function: avy-kill-ring-save-whole-line
avy-kill-ring-save-whole-line is an autoloaded, interactive and
byte-compiled function defined in avy.el.
Signature
(avy-kill-ring-save-whole-line ARG)
Documentation
Select line and save the whole selected line as if killed, but don’t kill it.
This command is similar to avy-kill-whole-line, except that it
saves the line(s) as if killed, but does not kill it(them).
With a numerical prefix ARG, kill ARG line(s) starting from the selected line. If ARG is negative, kill backward.
If ARG is zero, kill the selected line but exclude the trailing newline.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/avy-20241101.1357/avy.el
;;;###autoload
(defun avy-kill-ring-save-whole-line (arg)
"Select line and save the whole selected line as if killed, but don’t kill it.
This command is similar to `avy-kill-whole-line', except that it
saves the line(s) as if killed, but does not kill it(them).
With a numerical prefix ARG, kill ARG line(s) starting from the
selected line. If ARG is negative, kill backward.
If ARG is zero, kill the selected line but exclude the trailing
newline."
(interactive "P")
(let ((initial-window (selected-window)))
(avy-with avy-kill-ring-save-whole-line
(let* ((start (avy--line)))
(if (not (numberp start))
(user-error "Fail to select the line to kill")
(save-excursion
(let ((kill-read-only-ok t)
(buffer-read-only t))
(goto-char start)
(kill-whole-line arg))))))
(select-window initial-window)))