Relocate defcustom where it belongs

This commit is contained in:
Protesilaos Stavrou 2022-06-16 09:01:12 +03:00
parent 4041e437b2
commit 9be3cfab99
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -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.