Function: cider-ns-edit--clean-buffer

cider-ns-edit--clean-buffer is a byte-compiled function defined in cider-ns.el.

Signature

(cider-ns-edit--clean-buffer)

Documentation

Clean the ns form of the current buffer, and say what got removed.

Return what got removed.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20261106.1225/cider-ns.el
(defun cider-ns-edit--clean-buffer ()
  "Clean the ns form of the current buffer, and say what got removed.
Return what got removed."
  (let* ((start (cider-ns-edit--check))
         ;; Emacs 28's `line-number-at-pos' rejects a position outside
         ;; the narrowing, even an absolute one
         (unused (save-restriction
                   (widen)
                   (cider-sync-request:clean-ns
                    (buffer-substring-no-properties start (point-max))
                    (line-number-at-pos start)
                    (cider-ns-edit--platform))))
         (removed (car (cider-ns-edit--edit
                        (lambda (start) (cider-ns-edit--clean start unused))))))
    (when removed
      (message "Removed %s from the ns form" (cider-ns-edit--enumerate removed)))
    removed))