[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 79c22c2 06/62: Added new customization options for paced-l
From: |
Ian Dunn |
Subject: |
[elpa] master 79c22c2 06/62: Added new customization options for paced-load-all-dictionaries |
Date: |
Sat, 9 Dec 2017 14:33:56 -0500 (EST) |
branch: master
commit 79c22c2666255840082b9bfc7a0a5d5dbeed23dd
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Added new customization options for paced-load-all-dictionaries
* paced.el (paced-dictionary-directory-whitelist-regexp):
(paced-dictionary-directory-blacklist-regexp):
(paced-load-all-dictionaries-recursively): New defcustoms.
(paced-load-all-dictionaries): Implement them.
---
paced.el | 34 +++++++++++++++++++++++++++++++---
1 file changed, 31 insertions(+), 3 deletions(-)
diff --git a/paced.el b/paced.el
index 963441a..0a59842 100644
--- a/paced.el
+++ b/paced.el
@@ -82,6 +82,27 @@ the user whether to save dictionaries here."
:group 'paced
:type 'directory)
+(defcustom paced-dictionary-directory-whitelist-regexp ".*"
+ "Regexp to match when reading from the dictionary directory.
+
+Any files that match this regexp will be loaded by
+`paced-load-all-dictionaries'."
+ :group 'paced
+ :type 'regexp)
+
+(defcustom paced-dictionary-directory-blacklist-regexp "$^"
+ "Regexp to match for files NOT to load with `paced-load-all-dictionaries'.
+
+This is the string \"$^\" by default, which matches nothing, thus
+allowing all files."
+ :group 'paced
+ :type 'regexp)
+
+(defcustom paced-load-all-dictionaries-recursively nil
+ "Whether to recursively load all files with `paced-load-all-dictionaries'."
+ :group 'paced
+ :type 'boolean)
+
(defcustom paced-repopulate-saves-dictionary t
"Whether to save a dictionary after repopulation."
:group 'paced
@@ -339,9 +360,16 @@ be skipped."
(interactive)
(message "Loading all dictionaries from %s" paced-dictionary-directory)
(paced--ensure-dictionary-directory)
- (dolist (dict-file (directory-files paced-dictionary-directory t))
- (when (file-regular-p dict-file)
- (paced-load-dictionary-from-file dict-file))))
+ (let ((files-to-load
+ (if paced-load-all-dictionaries-recursively
+ (directory-files-recursively paced-dictionary-directory
+
paced-dictionary-directory-whitelist-regexp)
+ (directory-files paced-dictionary-directory t
+ paced-dictionary-directory-whitelist-regexp))))
+ (dolist (dict-file files-to-load)
+ (when (and (file-regular-p dict-file)
+ (not (string-match-p
paced-dictionary-directory-blacklist-regexp dict-file)))
+ (paced-load-dictionary-from-file dict-file)))))
(cl-defmethod eieio-done-customizing ((dict paced-dictionary))
(paced-register-dictionary (paced-dictionary-name dict) dict)
- [elpa] master updated (0775e8c -> 5b288be), Ian Dunn, 2017/12/09
- [elpa] master 9b61ee5 03/62: Added ede/proj-aux to bootstrap.sh, Ian Dunn, 2017/12/09
- [elpa] master 428098b 04/62: Added bzrignore file, Ian Dunn, 2017/12/09
- [elpa] master d854f3d 02/62: Fixed typos, Ian Dunn, 2017/12/09
- [elpa] master 52c8a88 10/62: Fixed usage of bzr send in documentation, Ian Dunn, 2017/12/09
- [elpa] master 262d99f 13/62: Added package requirements to paced.el, Ian Dunn, 2017/12/09
- [elpa] master 79c22c2 06/62: Added new customization options for paced-load-all-dictionaries,
Ian Dunn <=
- [elpa] master e404950 14/62: Alias if-let* and when-let* for backwards compatibility, Ian Dunn, 2017/12/09
- [elpa] master 6c014ae 15/62: Remove rx pcase form for compatibility, Ian Dunn, 2017/12/09
- [elpa] master ecb2f9d 12/62: Fixed up info title, Ian Dunn, 2017/12/09
- [elpa] master c369964 16/62: Reduce required Emacs version to 25.3, Ian Dunn, 2017/12/09
- [elpa] master de2260f 07/62: Documented the population commands, Ian Dunn, 2017/12/09
- [elpa] master febb200 08/62: Added function to submit a bug report, Ian Dunn, 2017/12/09
- [elpa] master b925c0b 17/62: Updated links in documentation, Ian Dunn, 2017/12/09
- [elpa] master 38979b5 18/62: Fixed up contributing documentation, Ian Dunn, 2017/12/09
- [elpa] master 4162bd4 22/62: Changed name of registered checker, Ian Dunn, 2017/12/09
- [elpa] master 302d4b4 28/62: Added convenience method for adding population commands, Ian Dunn, 2017/12/09