branch: externals/denote commit 387ac0c030ff39922c219308b14b2114628bb463 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Add denote--file-empty-p --- denote.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/denote.el b/denote.el index 311149c04b..71ddc9486d 100644 --- a/denote.el +++ b/denote.el @@ -139,6 +139,10 @@ trailing hyphen." "Make STR an appropriate file name slug." (downcase (denote--slug-hyphenate (denote--slug-no-punct str)))) +(defun denote--file-empty-p (file) + "Return non-nil if FILE is empty." + (zerop (or (file-attribute-size (file-attributes file)) 0))) + ;;;; Keywords (defun denote--directory-files ()