[Emacs] Fewer regexes for recentf-exclude
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7d04a5c41a
commit
446db02df4
@ -675,6 +675,25 @@ focus the new window immediately.
|
|||||||
(delete-window)))
|
(delete-window)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Extend ~add-to-list~
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: Custom-Elisp-Extend-add-to-list-eh2325605gj0
|
||||||
|
:END:
|
||||||
|
One function I find missing regarding ~add-to-list~ is ~add-all-to-list~
|
||||||
|
so I can add multiple elements to a list at once. Instead, with
|
||||||
|
vanilla Emacs, I have to repeatedly call ~add-to-list~. That’s not very
|
||||||
|
clean. Let’s declare this missing function:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun add-all-to-list (list-var elements &optional append compare-fn)
|
||||||
|
"Add ELEMENTS to the value of LIST-VAR if it isn’t there yet.
|
||||||
|
|
||||||
|
ELEMENTS is a list of values. For documentation on the variables
|
||||||
|
APPEND and COMPARE-FN, see `add-to-list'."
|
||||||
|
(let (return)
|
||||||
|
(dolist (elt elements return)
|
||||||
|
(setq return (add-to-list list-var elt append compare-fn)))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* Package Management
|
* Package Management
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: Package-Managementqpwkel6184j0
|
:CUSTOM_ID: Package-Managementqpwkel6184j0
|
||||||
@ -2760,16 +2779,20 @@ excluded files.
|
|||||||
:straight (:build t :type built-in)
|
:straight (:build t :type built-in)
|
||||||
:custom ((recentf-max-saved-items 2000))
|
:custom ((recentf-max-saved-items 2000))
|
||||||
:config
|
:config
|
||||||
(add-to-list 'recentf-exclude (rx (* any)
|
;; no Elfeed or native-comp files
|
||||||
(or "elfeed-db" "eln-cache")
|
(add-all-to-list 'recentf-exclude
|
||||||
(* any)))
|
`(,(rx (* any)
|
||||||
(add-to-list 'recentf-exclude (rx (* any)
|
(or "elfeed-db"
|
||||||
"conlanging/content"
|
"eln-cache"
|
||||||
(* any)
|
"conlanging/content"
|
||||||
(or "html" "pdf" "tex")))
|
"org/config"
|
||||||
(add-to-list 'recentf-exclude ".*/Mail/Sent.*")
|
"/Mail/Sent"
|
||||||
(add-to-list 'recentf-exclude ".*\\.cache/.*")
|
".cache/")
|
||||||
(add-to-list 'recentf-exclude "/rsync.*"))
|
(* any)
|
||||||
|
(? (or "html" "pdf" "tex" "epub")))
|
||||||
|
,(rx "/"
|
||||||
|
(or "rsync" "ssh" "tmp")
|
||||||
|
(* any)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Screenshot
|
*** Screenshot
|
||||||
|
Loading…
Reference in New Issue
Block a user