emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 66ccc65: Update standard image-dired thumbnail loca


From: Mark Oteiza
Subject: [Emacs-diffs] master 66ccc65: Update standard image-dired thumbnail location
Date: Wed, 14 Dec 2016 19:36:07 +0000 (UTC)

branch: master
commit 66ccc65935c389942f1bc72e968846d8dab9951b
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>

    Update standard image-dired thumbnail location
    
    * lisp/image-dired.el (image-dired-thumb-name): Conform to the latest
    standard: consider XDG_CACHE_HOME, falling back on ~/.cache.
---
 lisp/image-dired.el |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 1c99db3..066a994 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -587,9 +587,12 @@ the thumbnail file name unique.  For per-directory 
storage, just
 add a subdirectory.  For standard storage, produce the file name
 according to the Thumbnail Managing Standard."
   (cond ((eq 'standard image-dired-thumbnail-storage)
-         (expand-file-name
-          (concat "~/.thumbnails/normal/"
-                  (md5 (concat "file://" (expand-file-name file))) ".png")))
+         (let* ((xdg (getenv "XDG_CACHE_HOME"))
+                (dir (if (and xdg (file-name-absolute-p xdg))
+                         xdg "~/.cache")))
+           (expand-file-name
+            (concat (md5 (concat "file://" (expand-file-name file))) ".png")
+            (expand-file-name "thumbnails/normal" dir))))
         ((eq 'use-image-dired-dir image-dired-thumbnail-storage)
          (let* ((f (expand-file-name file))
                 (md5-hash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]