[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dired-preview bbb2606da9 3/3: Make dired-preview-ignore
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dired-preview bbb2606da9 3/3: Make dired-preview-ignored-extensions-regexp accept a nil value |
Date: |
Thu, 5 Oct 2023 03:57:58 -0400 (EDT) |
branch: externals/dired-preview
commit bbb2606da9a323744373cccd21c46956aa121723
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make dired-preview-ignored-extensions-regexp accept a nil value
---
dired-preview.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dired-preview.el b/dired-preview.el
index 8e8b083a1d..e0494c5220 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -74,9 +74,12 @@
"\\(mkv\\|webm\\|mp4\\|mp3\\|ogg\\|m4a"
"\\|gz\\|zst\\|tar\\|xz\\|rar\\|zip"
"\\|iso\\|epub\\|pdf\\)")
- "Regular expression of file type extensions to not preview."
+ "Regular expression of file type extensions to not preview.
+When the value is nil, do not ignore any file: preview
+everything."
:group 'dired-preview
- :type 'string)
+ :type '(choice (const :tag "Do not ignore any file (preview everything)" nil)
+ (string :tag "Ignore files matching regular expression")))
(defcustom dired-preview-max-size (expt 2 20)
"Files larger than this byte limit are not previewed."
@@ -191,7 +194,8 @@ until it drops below this number.")
(defun dired-preview--file-ignored-p (file)
"Return non-nil if FILE extension is among the ignored extensions.
See user option `dired-preview-ignored-extensions-regexp'."
- (when-let ((ext (file-name-extension file)))
+ (when-let (((stringp dired-preview-ignored-extensions-regexp))
+ (ext (file-name-extension file)))
(string-match-p ext dired-preview-ignored-extensions-regexp)))
(defun dired-preview--file-large-p (file)