]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify image-dired-thumbnail-storage customization
authorStefan Kangas <stefankangas@gmail.com>
Sat, 17 Sep 2022 19:06:30 +0000 (21:06 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Sat, 17 Sep 2022 22:18:22 +0000 (00:18 +0200)
* lisp/image/image-dired.el (image-dired-dir): Improve docstring.
(image-dired-thumbnail-storage): Change default to `image-dired',
maintain `use-image-dired-dir' for backwards compatibility.
* lisp/image/image-dired-util.el (image-dired-thumb-name): Handle
above new default value.

lisp/image/image-dired-util.el
lisp/image/image-dired.el

index cbe040128e8b163eec53b9997b431173180b823d..dcf0b22cfe287aca51da001675977b7f35df873b 100644 (file)
@@ -81,7 +81,9 @@ See also `image-dired-thumbnail-storage'."
             ;; MD5 is mandated by the Thumbnail Managing Standard.
             (concat (md5 (concat "file://" (expand-file-name file))) ".png")
             (expand-file-name thumbdir (xdg-cache-home)))))
-        ((eq 'use-image-dired-dir image-dired-thumbnail-storage)
+        ((or (eq 'image-dired 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)))))
index 4dee951eb37dfcef474937f2e5a7c180279f8c45..3bfb388db3cfca8b7b6fab944f2c6fdaa4ff93dc 100644 (file)
 (defcustom image-dired-dir (locate-user-emacs-file "image-dired/")
   "Directory where thumbnail images are stored.
 
-The value of this option will be ignored if Image-Dired is
-customized to use the Thumbnail Managing Standard; they will be
-saved in \"$XDG_CACHE_HOME/thumbnails/\" instead.  See
+The value of this option is ignored if Image-Dired is customized
+to use the Thumbnail Managing Standard; they will be saved in
+\"$XDG_CACHE_HOME/thumbnails/\" instead.  See
 `image-dired-thumbnail-storage'."
   :type 'directory)
 
-(defcustom image-dired-thumbnail-storage 'use-image-dired-dir
+(defcustom image-dired-thumbnail-storage 'image-dired
   "How `image-dired' stores thumbnail files.
-There are two ways that Image-Dired can store and generate
-thumbnails.  If you set this variable to one of the two following
-values, they will be stored in the JPEG format:
-
-- `use-image-dired-dir' means that the thumbnails are stored in a
-  central directory.
-
-- `per-directory' means that each thumbnail is stored in a
-  subdirectory called \".image-dired\" in the same directory
-  where the image file is.
-
-It can also use the \"Thumbnail Managing Standard\", which allows
-sharing of thumbnails across different programs.  Thumbnails will
-be stored in \"$XDG_CACHE_HOME/thumbnails/\" instead of in
-`image-dired-dir'.  Thumbnails are saved in the PNG format, and
-can be one of the following sizes:
-
-- `standard' means use thumbnails sized 128x128.
-- `standard-large' means use thumbnails sized 256x256.
-- `standard-x-large' means use thumbnails sized 512x512.
-- `standard-xx-large' means use thumbnails sized 1024x1024.
+There are three ways that Image-Dired can store and generate
+thumbnails:
+
+ 1. According to the \"Thumbnail Managing Standard\", which allows
+    sharing of thumbnails across different programs.  Thumbnails
+    will be stored in \"$XDG_CACHE_HOME/thumbnails/\"
+
+    Set this user option to one of the following values:
+
+    - `standard' means use thumbnails sized 128x128.
+    - `standard-large' means use thumbnails sized 256x256.
+    - `standard-x-large' means use thumbnails sized 512x512.
+    - `standard-xx-large' means use thumbnails sized 1024x1024.
+
+ 2. In the Image-Dired specific directory indicated by
+    `image-dired-dir'.
+
+    Set this user option to `image-dired' to use it (or
+    `use-image-dired-dir', which means the same thing for
+    backwards-compatibility reasons).
+
+ 3. In a subdirectory \".image-dired\" in the same directory
+    where the image files are.
+
+    Set this user option to `per-directory' to use it.
+
+To change the default size of thumbnails with (2) and (3) above,
+customize `image-dired-thumb-size'.
+
+With Thumbnail Managing Standard, save thumbnails in the PNG
+format, as mandated by that standard, and otherwise as JPEG.
 
 For more information on the Thumbnail Managing Standard, see:
 https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html"