From 244baa550beb3ca6f6b87cf86e2dae4465a87cbd Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 20 Nov 2021 11:09:23 +0100 Subject: [PATCH] image-dired: Improve some messages * lisp/image-dired.el (image-dired-dir) (image-dired-create-thumb-1): Improve messages. (image-dired-rotate-original): Signal 'user-error' instead of 'error'. --- lisp/image-dired.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 852ef0f1035..47a44a4a60e 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -520,14 +520,14 @@ Return the last form in BODY." ,@body)) (defun image-dired-dir () - "Return the current thumbnails directory (from variable `image-dired-dir'). -Create the thumbnails directory if it does not exist." + "Return the current thumbnail directory (from variable `image-dired-dir'). +Create the thumbnail directory if it does not exist." (let ((image-dired-dir (file-name-as-directory - (expand-file-name image-dired-dir)))) + (expand-file-name image-dired-dir)))) (unless (file-directory-p image-dired-dir) (with-file-modes #o700 (make-directory image-dired-dir t)) - (message "Creating thumbnails directory")) + (message "Thumbnail directory created: %s" image-dired-dir)) image-dired-dir)) (defun image-dired-insert-image (file type relief margin) @@ -743,9 +743,9 @@ and remove the cached thumbnail files between each trial run.") (thumbnail-dir (file-name-directory thumbnail-file)) process) (when (not (file-exists-p thumbnail-dir)) - (message "Creating thumbnail directory") (with-file-modes #o700 - (make-directory thumbnail-dir t))) + (make-directory thumbnail-dir t)) + (message "Thumbnail directory created: %s" thumbnail-dir)) ;; Thumbnail file creation processes begin here and are marshaled ;; in a queue by `image-dired-create-thumb'. @@ -2013,7 +2013,7 @@ With prefix argument ARG, display image in its original size." (cons ?o (expand-file-name file)) (cons ?t image-dired-temp-rotate-image-file)))) (unless (eq 'jpeg (image-type file)) - (error "Only JPEG images can be rotated!")) + (user-error "Only JPEG images can be rotated")) (if (not (= 0 (apply #'call-process image-dired-cmd-rotate-original-program nil nil nil (mapcar (lambda (arg) (format-spec arg spec)) -- 2.39.5