From ad903fd96c582388a2cd6212c78c5c1a84fe0055 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 3 Aug 2020 02:01:34 +0530 Subject: Print better log messages. * ennum.el (ennum-intern, ennum-publish-feed, ennum-publish-image, ennum-copy): Print log messages. (ennum-eval): Do not print "skipping build" messages. It is too verbose. --- ennum.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ennum.el b/ennum.el index a5a37ab..f4e5533 100644 --- a/ennum.el +++ b/ennum.el @@ -25,7 +25,8 @@ (interned-path (expand-file-name (file-name-nondirectory filename) store-item))) (unless (file-exists-p store-item) - (ennum-copy filename interned-path) + (message "Interning %s in %s" filename store-item) + (ennum-copy filename interned-path t) (ennum--set-file-modes-recursively store-item #o555 #o444 #o555)) interned-path)) @@ -79,8 +80,7 @@ respectively by - and _, and the pad character = is optional." ;; Create store if it doesn't exist (ennum-mkdir-p (ennum-setting :store)) ;; Create store item if it doesn't already exist - (if (file-exists-p output) - (message "Skipping build of %s" output) + (unless (file-exists-p output) (message "Building %s" output) (ennum-with-temporary-directory temporary-directory (ennum-with-current-directory temporary-directory @@ -448,6 +448,7 @@ result as a string." (ennum-intern (ennum-post-filename post))) posts))) (ennum-exp + (message "Writing %s" feed-file) ;; TODO: Create ennu-mkdir-p-for-file (when (file-name-directory feed-file) (ennum-mkdir-p (file-name-directory feed-file))) @@ -526,6 +527,7 @@ result as a string." (defun ennum-publish-image (image width) (let ((interned-image (ennum-intern image))) (ennum-exp + (message "Resizing %s to width %s" image width) (ennum-mkdir-p (ennum-setting :images-directory)) (ennum-image-optimize-image (ennum-image-resize-image @@ -551,9 +553,11 @@ result as a string." (defun ennum-mkdir-p (directory) (make-directory directory t)) -(defun ennum-copy (source destination) +(defun ennum-copy (source destination &optional quiet) "Copy file or directory from SOURCE to DESTINATION. Overwrite if DESTINATION already exists." + (unless quiet + (message "Copying %s to %s" source destination)) (if (file-directory-p source) (copy-directory source destination) (when (file-name-directory destination) -- cgit v1.2.3