diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2022-09-25 14:22:06 +0200 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2022-09-25 14:27:51 +0200 |
commit | a256f49f0828a2069acc302dd11d78be2486b565 (patch) | |
tree | 9cbc83e794b38d16c35d533c59cbb10a7b5705eb /lisp/image/image-dired-util.el | |
parent | 971566e88a9fdb414b3c821cb55a7fc0e903eeba (diff) | |
download | emacs-a256f49f0828a2069acc302dd11d78be2486b565.tar.gz emacs-a256f49f0828a2069acc302dd11d78be2486b565.tar.bz2 emacs-a256f49f0828a2069acc302dd11d78be2486b565.zip |
Make image-dired-thumb-name more portable
* lisp/image/image-dired-util.el
(image-dired-thumb-name): Create file names in a portable manner.
* test/lisp/image/image-dired-util-tests.el
(image-dired-thumb-name/standard)
(image-dired-thumb-name/image-dired)
(image-dired-thumb-name/per-directory): Expand tests.
Diffstat (limited to 'lisp/image/image-dired-util.el')
-rw-r--r-- | lisp/image/image-dired-util.el | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index f8e81d2e8d7..e7d116d90ba 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -85,19 +85,22 @@ See also `image-dired-thumbnail-storage'." ;; Maintained for backwards compatibility: (eq 'use-image-dired-dir image-dired-thumbnail-storage)) (let* ((f (expand-file-name file)) - (hash - (md5 (file-name-as-directory (file-name-directory f))))) - (format "%s%s%s.thumb.%s" - (file-name-as-directory (expand-file-name (image-dired-dir))) - (file-name-base f) - (if hash (concat "_" hash) "") - (file-name-extension f)))) + (hash (md5 (file-name-as-directory (file-name-directory f))))) + (expand-file-name + (format "%s%s.thumb.%s" + (file-name-base f) + (if hash (concat "_" hash) "") + (file-name-extension f)) + (image-dired-dir)))) ((eq 'per-directory image-dired-thumbnail-storage) (let ((f (expand-file-name file))) - (format "%s.image-dired/%s.thumb.%s" - (file-name-directory f) - (file-name-base f) - (file-name-extension f)))))) + (expand-file-name + (format "%s.thumb.%s" + (file-name-base f) + (file-name-extension f)) + (expand-file-name + ".image-dired" + (file-name-directory f))))))) (defvar image-dired-thumbnail-buffer "*image-dired*" "Image-Dired's thumbnail buffer.") |