branch: externals/dired-preview
commit 7575a6e8feda3f965af81b54a3494a99a771a07c
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Prevent preview of "self" directory
    
    Thanks to Inkbottle007 for reporting the bug in issue 23:
    <https://github.com/protesilaos/dired-preview/issues/23>.
---
 README.org       | 2 +-
 dired-preview.el | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index b786a31131..f4c10c76c7 100644
--- a/README.org
+++ b/README.org
@@ -367,7 +367,7 @@ matters.
   Stefan Monnier, Philip Kaludercic, Nofint.
 
 + Ideas and/or user feedback :: Bruno Boal, Ed Hamilton, Karthik
-  Chikmagalur, Peter Prevos, Ramon Diaz-Uriarte, artelse.
+  Chikmagalur, Peter Prevos, Ramon Diaz-Uriarte, artelse, Inkbottle007.
 
 * GNU Free Documentation License
 :PROPERTIES:
diff --git a/dired-preview.el b/dired-preview.el
index 03b77318a5..c8ee6d9d29 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -688,6 +688,7 @@ With optional MAKE-PUBLIC, remove the indicator."
 (defun dired-preview--preview-p (file)
   "Return non-nil if FILE can be previewed."
   (and file
+       (not (string-match-p "/\\./" file))
        (or (file-regular-p file) (file-directory-p file))
        (file-readable-p file)
        (not (dired-preview--file-displayed-p file))

Reply via email to