diff --git a/denote-dired.el b/denote-dired.el index 9619a49..e5246ef 100644 --- a/denote-dired.el +++ b/denote-dired.el @@ -85,22 +85,6 @@ old name followed by the new one." :type 'boolean :group 'denote-dired) -;;;; Commands - -(defun denote-dired--file-attributes-time (file) - "Return `file-attribute-modification-time' of FILE as identifier." - (format-time-string - denote--id-format - (file-attribute-modification-time (file-attributes file)))) - -(defun denote-dired--file-name-id (file) - "Return FILE identifier, else generate one." - (cond - ((string-match denote--id-regexp file) - (substring file (match-beginning 0) (match-end 0))) - ((denote-dired--file-attributes-time file)) - (t (format-time-string denote--id-format)))) - (defcustom denote-dired-post-rename-functions (list #'denote-dired-rewrite-front-matter) "List of functions called after `denote-dired-rename-file'. @@ -121,6 +105,22 @@ everything works as intended." :type 'hook :group 'denote-dired) +;;;; Commands + +(defun denote-dired--file-attributes-time (file) + "Return `file-attribute-modification-time' of FILE as identifier." + (format-time-string + denote--id-format + (file-attribute-modification-time (file-attributes file)))) + +(defun denote-dired--file-name-id (file) + "Return FILE identifier, else generate one." + (cond + ((string-match denote--id-regexp file) + (substring file (match-beginning 0) (match-end 0))) + ((denote-dired--file-attributes-time file)) + (t (format-time-string denote--id-format)))) + ;;;###autoload (defun denote-dired-rename-file (file title keywords) "Rename FILE to include TITLE and KEYWORDS.