<commit_before>;;; base-projects.el --- Project configuration

;;; Commentary:
;; Project management.

;;; Code:
(require 'base-vars)

(use-package projectile :demand t
  :diminish projectile-mode
  :functions projectile-ignored-directories
  :preface
  (defun my|projectile-cache-current-file (orig-fun &rest args)
    "Don't cache ignored files."
    (unless (cl-some (lambda (path)
                       (string-prefix-p buffer-file-name
                                        (expand-file-name path)))
                     (projectile-ignored-directories))
      (apply orig-fun args)))
  :init
  (setq projectile-cache-file (concat my-cache-dir "projectile.cache")
        projectile-enable-caching (not noninteractive)
        projectile-file-exists-remote-cache-expire nil
        projectile-globally-ignored-file-suffixes
        '(".elc" ".pyc" ".o" ".hi" ".class" ".cache")
        projectile-globally-ignored-files
        '("TAGS" "GPATH" "GRTAGS" "GTAGS")
        projectile-indexing-method 'alien
        projectile-ignored-projects `(,my-data-dir)
        projectile-known-projects-file (concat my-cache-dir "projectile.projects"))
  :config
  (projectile-mode +1)

  (setq projectile-other-file-alist
        (append '(("less" "css")
                  ("styl" "css")
                  ("sass" "css")
                  ("scss" "css")
                  ("css" "scss" "sass" "less" "styl")
                  ("jade" "html")
                  ("pug" "html")
                  ("html" "jade" "pug" "jsx" "tsx"))
                projectile-other-file-alist))

  (advice-add #'projectile-cache-current-file :around #'my|projectile-cache-current-file))

;;;
;; Buffer filtering
(defun is-useful-buffer (buffer)
  "Determine if BUFFER is useful."
  (not (string-match
        "^ ?\\*.*\\*\\(<[0-9]+>\\)?$"<commit_msg>projects: disable cache<commit_after>;;; base-projects.el --- Project configuration

;;; Commentary:
;; Project management.

;;; Code:
(require 'base-vars)

(use-package projectile :demand t
  :diminish projectile-mode
  :functions projectile-ignored-directories
  :preface
  (defun my|projectile-cache-current-file (orig-fun &rest args)
    "Don't cache ignored files."
    (unless (cl-some (lambda (path)
                       (string-prefix-p buffer-file-name
                                        (expand-file-name path)))
                     (projectile-ignored-directories))
      (apply orig-fun args)))
  :init
  (setq projectile-cache-file (concat my-cache-dir "projectile.cache")
        projectile-enable-caching nil
        projectile-file-exists-remote-cache-expire nil
        projectile-globally-ignored-file-suffixes
        '(".elc" ".pyc" ".o" ".hi" ".class" ".cache")
        projectile-globally-ignored-files
        '("TAGS" "GPATH" "GRTAGS" "GTAGS")
        projectile-indexing-method 'alien
        projectile-ignored-projects `(,my-data-dir)
        projectile-known-projects-file (concat my-cache-dir "projectile.projects"))
  :config
  (projectile-mode +1)

  (setq projectile-other-file-alist
        (append '(("less" "css")
                  ("styl" "css")
                  ("sass" "css")
                  ("scss" "css")
                  ("css" "scss" "sass" "less" "styl")
                  ("jade" "html")
                  ("pug" "html")
                  ("html" "jade" "pug" "jsx" "tsx"))
                projectile-other-file-alist))

  (advice-add #'projectile-cache-current-file :around #'my|projectile-cache-current-file))

;;;
;; Buffer filtering
(defun is-useful-buffer (buffer)
  "Determine if BUFFER is useful."
  (not (string-match
        "^ ?\\*.*\\*\\(<[0-9]+>\\)?$"
{'fraction_non_alphanumeric': 0.15994513031550067, 'fraction_numerical': 0.0016460905349794238, 'mean_word_length': 2.181500872600349, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '199329', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1166, 'n_words': 234}