<commit_before>(require 'find-file-in-project)

;; Use eproject to find project root
(setq ffip-project-root-function 'eproject-root)
;; No need to be stingy
(setq ffip-limit 4096)

;; Helper methods to create local settings
(defun ffip--create-exclude-find-options (names)
  (mapconcat (lambda (name)
               (concat "-not -regex \".*" name ".*\"")) names " "))

(defun ffip-local-excludes (&rest names)
  "Given a set of names, will exclude results with those names in the path.
Example:
(ffip-local-excludes \"target\" \"overlays\")
"
  (set (make-local-variable 'ffip-find-options)
       (ffip--create-exclude-find-options names)))

(defun ffip-local-patterns (&rest patterns)
  "An exhaustive list of file name patterns to look for.
Example:
(ffip-local-patterns \"*.js\" \"*.jsp\" \"*.css\")
"
  (set (make-local-variable 'ffip-patterns) patterns))

;; Function to create new functions that look for a specific pattern
(defun ffip-create-pattern-file-finder (&rest patterns)
  (lexical-let ((patterns patterns))
    (lambda ()
      (interactive)
      (let ((ffip-patterns patterns))
        (find-file-in-project)))))

;; Default excludes - override with ffip-local-excludes
(setq ffip-find-options
      (ffip--create-exclude-find-options
       '("node_modules"
         "target"
         "overlays"
         "vendor")))

;; key bindings
(global-set-key (kbd "C-x o") 'find-file-in-project)
;; Find file in project, with specific patterns
(global-unset-key (kbd "C-x C-o")) ;; which used to be delete-blank-lines<commit_msg>set patterns for ffip<commit_after>(require 'find-file-in-project)

;; Use eproject to find project root
(setq ffip-project-root-function 'eproject-root)
;; That's a limit...
(setq ffip-limit 32768)

(setq ffip-patterns
  '(
    "*.clj"
    "*.el"
    "*.erl"
    "*.htm"
    "*.html"
    "*.java"
    "*.jelly"
    "*.js"
    "*.md"
    "*.org"
    "*.pl"
    "*.py"
    "*.rb"
    "*.txt"
    ))

;; Helper methods to create local settings
(defun ffip--create-exclude-find-options (names)
  (mapconcat (lambda (name)
               (concat "-not -regex \".*" name ".*\"")) names " "))

(defun ffip-local-excludes (&rest names)
  "Given a set of names, will exclude results with those names in the path. Example: (ffip-local-excludes \"target\" \"overlays\") "
  (set (make-local-variable 'ffip-find-options)
       (ffip--create-exclude-find-options names)))

;; Function to create new functions that look for a specific pattern
(defun ffip-create-pattern-file-finder (&rest patterns)
  (lexical-let ((patterns patterns))
    (lambda ()
      (interactive)
      (let ((ffip-patterns patterns))
        (find-file-in-project)))))

;; Default excludes - override with ffip-local-excludes
(setq ffip-find-options
      (ffip--create-exclude-find-options
       '("node_modules"
         "target"
         "overlays"
         "vendor")))

;; key bindings
(global-set-key (kbd "C-x o") 'find-file-in-project)
;; Find file in project, with specific patterns
(global-unset-key (kbd "C-x C-o")) ;; which used to be delete-blank-lines
{'fraction_non_alphanumeric': 0.16058631921824104, 'fraction_numerical': 0.0029315960912052116, 'mean_word_length': 3.067549668874172, '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': '239442', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1032, 'n_words': 283}