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

    Use 'file-regular-p' instead of 'file-exists-p'
    
    This way we do not try to preview named pipes and sockets.
    
    Thanks to Karthik Chikmagalur for bringing this matter to my
    attention: 
<https://lists.sr.ht/~protesilaos/general-issues/%3C87pm5cnpaf.fsf%40gmail.com%3E>.
---
 dired-preview.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dired-preview.el b/dired-preview.el
index de0417098c..97bbf86545 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -271,7 +271,7 @@ Only do it with the current major mode is Dired."
 
 (defun dired-preview--preview-p (file)
   "Return non-nil if FILE can be previewed."
-  (and (file-exists-p file)
+  (and (file-regular-p file)
        (not (file-directory-p file))
        (not (dired-preview--file-displayed-p file))
        (not (dired-preview--file-ignored-p file))

Reply via email to