Function: avy-move-line
avy-move-line is an interactive and natively compiled function defined
in avy.el.
Signature
(avy-move-line ARG)
Documentation
Move a selected line above the current line.
ARG lines can be used.
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/015952xhg9b72ira1qyjvb30bn11jiv3-emacs-packages-deps/share/emacs/site-lisp/elpa/avy-20241101.1357/avy.el
;;;###autoload
(defun avy-move-line (arg)
"Move a selected line above the current line.
ARG lines can be used."
(interactive "p")
(let ((initial-window (selected-window)))
(avy-with avy-move-line
(let ((start (avy--line)))
(save-excursion
(goto-char start)
(kill-whole-line arg))
(select-window initial-window)
(cond ((eq avy-line-insert-style 'above)
(beginning-of-line)
(save-excursion
(insert
(current-kill 0))))
((eq avy-line-insert-style 'below)
(end-of-line)
(newline)
(save-excursion
(insert (substring (current-kill 0) 0 -1))))
(t
(user-error "Unexpected `avy-line-insert-style'")))))))