emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote 0b8a24ca0c 2/9: Add helper to check regular+writ


From: ELPA Syncer
Subject: [elpa] externals/denote 0b8a24ca0c 2/9: Add helper to check regular+writable file
Date: Sat, 13 Aug 2022 03:57:29 -0400 (EDT)

branch: externals/denote
commit 0b8a24ca0cae4859119aa2e92fe6b0a13d70b03c
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add helper to check regular+writable file
---
 denote.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/denote.el b/denote.el
index 76cc843914..ba5078e3f9 100644
--- a/denote.el
+++ b/denote.el
@@ -455,10 +455,14 @@ trailing hyphen."
   "Return non-nil if FILE has supported extension."
   (string-match-p (format "%s\\(.gpg\\)?\\'" denote--extension-regexp) file))
 
+(defun denote--file-regular-writable-p (file)
+  "Return non-nil if FILE is regular and writable."
+  (and (file-regular-p file)
+       (file-writable-p file)))
+
 (defun denote--writable-and-supported-p (file)
   "Return non-nil if FILE is writable and has supported extension."
-  (and (file-regular-p file)
-       (file-writable-p file)
+  (and (denote--file-regular-writable-p file)
        (denote--file-supported-extension-p file)))
 
 (defun denote--file-name-relative-to-denote-directory (file)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]