<commit_before>;;; core-lib.el

(require 'cl-lib)

;;
(autoload 'when-let "subr-x")
(autoload 'if-let "subr-x")

;; I don't use use-package for these to save on the `fboundp' lookups it does
;; for its :commands property. I use dolists instead of mapc to avoid extra
;; stackframes allocated for lambdas. This is _definitely_ premature
;; optimization.
(dolist (sym '(async-start async-start-process async-byte-recompile-directory))
  (autoload sym "async"))

(dolist (sym '(persistent-soft-exists-p persistent-soft-fetch
               persistent-soft-flush persistent-soft-store))
  (autoload sym "persistent-soft"))

(dolist (sym '(s-trim s-trim-left s-trim-right s-chomp s-collapse-whitespace
               s-word-wrap s-center s-pad-left s-pad-right s-truncate s-left
               s-right s-chop-suffix s-chop-suffixes s-chop-prefix
               s-chop-prefixes s-shared-start s-shared-end s-repeat s-concat
               s-prepend s-append s-lines s-match s-match-strings-all
               s-matched-positions-all s-slice-at s-split s-split-up-to s-join
               s-equals? s-less? s-matches? s-blank? s-present? s-ends-with?
               s-starts-with? s-contains? s-lowercase? s-uppercase? s-mixedcase?
               s-capitalized? s-numeric? s-replace s-replace-all s-downcase
               s-upcase s-capitalize s-titleize s-with s-index-of s-reverse
               s-presence s-format s-lex-format s-count-matches s-wrap
               s-split-words s-lower-camel-case s-upper-camel-case s-snake-case
               s-dashed-words s-capitalized-words s-titleized-words
               s-word-initials))
  (autoload sym "s"))


;;
;; Helpers
;;

(defun doom--resolve-paths (paths &optional root)
  (cond ((stringp paths)
         `(file-exists-p
           (expand-file-name
            ,paths ,(if (or (string-prefix-p "./" paths)
                            (string-prefix-p "../" paths))
                        'default-directory
                      (or root `(doom-project-root))))))
        ((listp paths)
         (let (forms)<commit_msg>core-lib: reduce s.el autoloads, add subr-x autoloads<commit_after>;;; core-lib.el

(require 'cl-lib)

;; I don't use use-package for these to save on the `fboundp' lookups it does
;; for its :commands property. I use dolists instead of mapc to avoid extra
;; stackframes allocated for lambdas. This is _definitely_ premature
;; optimization.
(dolist (sym '(async-start async-start-process async-byte-recompile-directory))
  (autoload sym "async"))

(dolist (sym '(persistent-soft-exists-p persistent-soft-fetch
               persistent-soft-flush persistent-soft-store))
  (autoload sym "persistent-soft"))

(dolist (sym '(s-center s-pad-left s-pad-right s-truncate s-chop-suffix
               s-chop-suffixes s-chop-prefix s-chop-prefixes s-join s-replace
               s-replace-all s-capitalize s-titleize s-split-words
               s-capitalized-words s-titleized-words))
  (autoload sym "s"))

(dolist (sym '(when-let if-let string-trim string-join string-blank-p string-lessp))
  (autoload sym "subr-x"))


;;
;; Helpers
;;

(defun doom--resolve-paths (paths &optional root)
  (cond ((stringp paths)
         `(file-exists-p
           (expand-file-name
            ,paths ,(if (or (string-prefix-p "./" paths)
                            (string-prefix-p "../" paths))
                        'default-directory
                      (or root `(doom-project-root))))))
        ((listp paths)
         (let (forms)
{'fraction_non_alphanumeric': 0.13236134934248142, 'fraction_numerical': 0.0, 'mean_word_length': 2.260950605778192, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7611614', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1142, 'n_words': 279}