<commit_before>(add-hook 'after-init-hook (lambda () (recentf-mode 1)))
(setq-default
 recentf-max-saved-items 1000
 recentf-exclude `("/tmp/"
                   ,(expand-file-name "~/\\.emacs\\.d/elpa/")
                   ,(expand-file-name "~/\\.emacs\\.d/workspace/")
                   ".*/.metals/"
                   "/usr/include"
                   "/usr/local/include"))

(defun remove-recentf-action(x)
  (defvar recentf-exclude)
  (let ((recentf-exclude (list x)))
    (funcall #'recentf-cleanup)))

(defun remove-recentf()
  "Remove selected folder from recentf list."
  (interactive)
  (ivy-read "Remove from recentf list: "
            (delete-dups (mapcar #'file-name-directory recentf-list))
            :action #'remove-recentf-action))

(provide 'init-recentf)<commit_msg>update recentf<commit_after>;;; init-recentf.el  -*- lexical-binding: t -*-

(add-hook 'after-init-hook (lambda () (recentf-mode 1)))
(setq-default
 recentf-max-saved-items 1000
 recentf-exclude `("/tmp/"
                   ,(expand-file-name "~/\\.emacs\\.d/elpa/")
                   ,(expand-file-name "~/\\.emacs\\.d/workspace/")
                   "/Applications/"
                   ".*/.metals/"
                   "/usr/include"
                   "/usr/local/include"))

(defun get-recentf-exclude-list(name)
  (if (s-suffix-p "//" name)
      (seq-filter (apply-partially #'s-starts-with-p (substring name 0 -1)) recentf-list)
    (list name)))

(defun delete-recentf-action(item)
  (defvar recentf-exclude)
  (let ((recentf-exclude (get-recentf-exclude-list item)))
    (call-interactively #'recentf-cleanup)))

(defun delete-from-recentf()
  "Delete selected folder from recentf list."
  (interactive)
  (ivy-read "Delete from recentf list: "
            (delete-dups (mapcar #'file-name-directory recentf-list))
            :action #'delete-recentf-action))

(provide 'init-recentf)
{'fraction_non_alphanumeric': 0.176033934252386, 'fraction_numerical': 0.006362672322375398, 'mean_word_length': 2.270363951473137, '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': '5962779', 'n_tokens_mistral': 681, 'n_tokens_neox': 620, 'n_words': 118}