Function: combobulate--yeet

combobulate--yeet is a natively compiled function defined in combobulate-manipulation.el.

Signature

(combobulate--yeet POINT-NODE)

Source Code

;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-manipulation.el
(defun combobulate--yeet (point-node)
  (let* ((source-node (or (car (reverse (combobulate-nav-get-siblings point-node)))
                          (error "No valid sibling node.")))
         (target-node
          (save-excursion
            (combobulate-move-to-node
             (with-navigation-nodes (:procedures (combobulate-read procedures-hierarchy))
               (combobulate-nav-get-parent point-node)))
            (or (combobulate-proxy-node-make-from-nodes (combobulate--get-sibling
                                                         (combobulate-node-at-point)
                                                         'forward))
                (error "No valid sibling node.")))))
    (save-excursion
      (let ((pos))
        (combobulate-refactor ()
          (mark-range-move
           (combobulate-node-start source-node)
           (combobulate-node-end source-node)
           (progn
             (combobulate-move-to-node target-node)
             (back-to-indentation)
             (split-line 1)
             (setq pos (point-marker))))
          (commit))
        (delete-blank-lines)
        (goto-char pos)
        (delete-blank-lines)))))