Function: dired-async--smart-create-files

dired-async--smart-create-files is a natively compiled function defined in dired-async.el.

Signature

(dired-async--smart-create-files OLD-FUNC FILE-CREATOR OPERATION FN-LIST NAME-CONSTRUCTOR &optional MARKER-CHAR)

Documentation

Around advice for dired-create-files.

Uses async like dired-async-create-files but skips certain fast cases if dired-async-skip-fast is non-nil.

Source Code

;; Defined in /nix/store/jhxqyr2zk061dl3wd3vm38lw3zin47b9-emacs-packages-deps/share/emacs/site-lisp/elpa/async-20260729.1431/dired-async.el
(defun dired-async--smart-create-files (old-func file-creator
                                                 operation fn-list name-constructor
                                                 &optional marker-char)
  "Around advice for `dired-create-files'.
Uses async like `dired-async-create-files' but skips certain fast
cases if `dired-async-skip-fast' is non-nil."
  (let ((total-size 0)
        async-list quick-list)
    (if (or (eq file-creator 'backup-file)
            (null dired-async-skip-fast))
        (setq async-list fn-list)
      (dolist (old fn-list)
        (let ((attrs (file-attributes old)))
          (if (dired-async--skip-async-p
               file-creator old name-constructor attrs)
              (progn
                (push old quick-list)
                (setq total-size (+ total-size (nth 7 attrs))))
            (push old async-list))))
      (when (> total-size dired-async-small-file-max)
        (setq async-list (append quick-list async-list)
              quick-list nil)))
    (when async-list
      (dired-async-create-files
       file-creator operation (nreverse async-list)
       name-constructor marker-char))
    (when quick-list
      (funcall old-func file-creator operation
               (nreverse quick-list) name-constructor marker-char))))