branch: externals/denote commit cade15b36a72a1d6daaece1a46fee95a0d608796 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Reorganise some functions by order of first appearance --- denote.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/denote.el b/denote.el index d8b750b529..a60d4d3cf3 100644 --- a/denote.el +++ b/denote.el @@ -689,13 +689,13 @@ signatures and keywords." "Return non-nil if FILE is empty." (zerop (or (file-attribute-size (file-attributes file)) 0))) -(defun denote-file-is-note-p (file) - "Return non-nil if FILE is an actual Denote note. -For our purposes, a note must not be a directory, must satisfy -`file-regular-p' and `denote-filename-is-note-p'." - (and (not (file-directory-p file)) - (file-regular-p file) - (denote-filename-is-note-p file))) +(defun denote-file-has-supported-extension-p (file) + "Return non-nil if FILE has supported extension. +Also account for the possibility of an added .gpg suffix. +Supported extensions are those implied by `denote-file-type'." + (seq-some (lambda (e) + (string-suffix-p e file)) + (denote-file-type-extensions-with-encryption))) (defun denote-filename-is-note-p (filename) "Return non-nil if FILENAME is a valid name for a Denote note. @@ -707,6 +707,14 @@ and use one of the extensions implied by `denote-file-type'." (file-name-nondirectory filename)) (denote-file-has-supported-extension-p filename))) +(defun denote-file-is-note-p (file) + "Return non-nil if FILE is an actual Denote note. +For our purposes, a note must not be a directory, must satisfy +`file-regular-p' and `denote-filename-is-note-p'." + (and (not (file-directory-p file)) + (file-regular-p file) + (denote-filename-is-note-p file))) + (defun denote-file-has-identifier-p (file) "Return non-nil if FILE has a Denote identifier." (when file @@ -721,14 +729,6 @@ and use one of the extensions implied by `denote-file-type'." (make-obsolete 'denote-file-directory-p nil "2.0.0") -(defun denote-file-has-supported-extension-p (file) - "Return non-nil if FILE has supported extension. -Also account for the possibility of an added .gpg suffix. -Supported extensions are those implied by `denote-file-type'." - (seq-some (lambda (e) - (string-suffix-p e file)) - (denote-file-type-extensions-with-encryption))) - (defun denote--file-regular-writable-p (file) "Return non-nil if FILE is regular and writable." (and (file-regular-p file)