Function: combobulate-kill-node-dwim

combobulate-kill-node-dwim is an interactive and natively compiled function defined in combobulate-manipulation.el.

Signature

(combobulate-kill-node-dwim &optional ARG)

Documentation

Kill the most likely node on or near point ARG times.

The exact node that is killed will depend on the location of point relative to the nodes in combobulate-navigable-nodes.

Key Bindings

combobulate-key-map M-k

Source Code

;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-manipulation.el
(defun combobulate-kill-node-dwim (&optional arg)
  "Kill the most likely node on or near point ARG times.

The exact node that is killed will depend on the location of
point relative to the nodes in
`combobulate-navigable-nodes'."
  (interactive "p")
  (with-argument-repetition arg
    (with-navigation-nodes (:procedures (combobulate-read procedures-sibling))
      (when-let* ((nearest (save-excursion
                             (combobulate-skip-whitespace-forward t)
                             (combobulate--get-nearest-navigable-node)))
                  (node (combobulate-proxy-node-make-from-nodes
                         (or (combobulate-nav-get-self-sibling nearest)
                             nearest))))
        ;; prevent killing nodes before point; that'd be weird.
        (if (combobulate-node-on-or-after-point-p node)
            (progn (let ((text (combobulate--consume-node node t)))
                     (if (eq last-command 'combobulate-kill-node-dwim)
                         (kill-append text nil)
                       (kill-new text)))
                   (combobulate-message "Killed node" node))
          (error "No node to kill"))))))