]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename 'image-dired-db-file' to 'image-dired-tags-db-file'
authorStefan Kangas <stefankangas@gmail.com>
Fri, 23 Sep 2022 13:01:36 +0000 (15:01 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Fri, 23 Sep 2022 13:18:59 +0000 (15:18 +0200)
* lisp/image/image-dired.el (image-dired-tags-db-file): Rename
from 'image-dired-db-file'.  Update all uses and make old name
into an obsolete variable alias.

etc/NEWS
lisp/image/image-dired-tags.el
lisp/image/image-dired.el

index 7a573b5e831385c7522a86dcde29bf1701997aeb..d7a6cc60ebb7e10eb2ed1173da32c2649526d644 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2157,6 +2157,9 @@ nil to disable this confirmation completely.
 ---
 *** 'image-dired-thumb-size' increased to 128.
 
+---
+*** 'image-dired-db-file' renamed to 'image-dired-tags-db-file'.
+
 ---
 *** 'image-dired-thumb-{height,width}' are now obsolete.
 Customize 'image-dired-thumb-size' instead, which will set both the
index e97bf70e89a87c81db038e56f0a7c891d450c641..7a837875ce427ffd94d8f010d49e9c7a4ea57b91 100644 (file)
 
 (defvar image-dired-dir)
 (defvar image-dired-thumbnail-storage)
-(defvar image-dired-db-file)
+(defvar image-dired-tags-db-file)
 
 (defmacro image-dired--with-db-file (&rest body)
-  "Run BODY in a temp buffer containing `image-dired-db-file'.
+  "Run BODY in a temp buffer containing `image-dired-tags-db-file'.
 Return the last form in BODY."
   (declare (indent 0) (debug t))
   `(with-temp-buffer
-     (if (file-exists-p image-dired-db-file)
-         (insert-file-contents image-dired-db-file))
+     (if (file-exists-p image-dired-tags-db-file)
+         (insert-file-contents image-dired-tags-db-file))
      ,@body))
 
 (defun image-dired-sane-db-file ()
-  "Check if `image-dired-db-file' exists.
+  "Check if `image-dired-tags-db-file' exists.
 If not, try to create it (including any parent directories).
 Signal error if there are problems creating it."
-  (or (file-exists-p image-dired-db-file)
+  (or (file-exists-p image-dired-tags-db-file)
       (let (dir buf)
         (unless (file-directory-p (setq dir (file-name-directory
-                                             image-dired-db-file)))
+                                             image-dired-tags-db-file)))
           (with-file-modes #o700
             (make-directory dir t)))
         (with-current-buffer (setq buf (create-file-buffer
-                                        image-dired-db-file))
+                                        image-dired-tags-db-file))
           (with-file-modes #o600
-            (write-file image-dired-db-file)))
+            (write-file image-dired-tags-db-file)))
         (kill-buffer buf)
-        (file-exists-p image-dired-db-file))
-      (error "Could not create %s" image-dired-db-file)))
+        (file-exists-p image-dired-tags-db-file))
+      (error "Could not create %s" image-dired-tags-db-file)))
 
 (defvar image-dired-tag-history nil "Variable holding the tag history.")
 
@@ -74,7 +74,7 @@ FILE-TAGS is an alist in the following form:
   (image-dired-sane-db-file)
   (let (end file tag)
     (image-dired--with-db-file
-      (setq buffer-file-name image-dired-db-file)
+      (setq buffer-file-name image-dired-tags-db-file)
       (dolist (elt file-tags)
         (setq file (car elt)
               tag (cdr elt))
@@ -94,7 +94,7 @@ FILE-TAGS is an alist in the following form:
   "For all FILES, remove TAG from the image database."
   (image-dired-sane-db-file)
   (image-dired--with-db-file
-    (setq buffer-file-name image-dired-db-file)
+    (setq buffer-file-name image-dired-tags-db-file)
     (let (end)
       (unless (listp files)
         (if (stringp files)
@@ -194,7 +194,7 @@ FILE-COMMENTS is an alist on the following form:
   (image-dired-sane-db-file)
   (let (end comment-beg-pos comment-end-pos file comment)
     (image-dired--with-db-file
-      (setq buffer-file-name image-dired-db-file)
+      (setq buffer-file-name image-dired-tags-db-file)
       (dolist (elt file-comments)
         (setq file (car elt)
               comment (cdr elt))
index bcff62484fd53916ff90a9179fba7f6c6c851142..1b8b1f1df7be2dfa2b3cd378f1df7cde9185ffe1 100644 (file)
@@ -98,7 +98,7 @@
 ;;   option `image-dired-thumbnail-storage'.
 ;;
 ;; * WARNING: The "database" format used might be changed so keep a
-;;   backup of `image-dired-db-file' when testing new versions.
+;;   backup of `image-dired-tags-db-file' when testing new versions.
 ;;
 ;; TODO
 ;; ====
@@ -211,7 +211,9 @@ https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html
                  (const :tag "Per-directory" per-directory))
   :version "29.1")
 
-(defcustom image-dired-db-file
+(define-obsolete-variable-alias 'image-dired-db-file
+  'image-dired-tags-db-file "29.1")
+(defcustom image-dired-tags-db-file
   (expand-file-name ".image-dired_db" image-dired-dir)
   "Database file where file names and their associated tags are stored."
   :type 'file)