From: Stefan Kangas Date: Fri, 23 Sep 2022 13:01:36 +0000 (+0200) Subject: Rename 'image-dired-db-file' to 'image-dired-tags-db-file' X-Git-Tag: emacs-29.0.90~1856^2~302 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=651c8ab5c5a994fe56d8af0249cc2f61c8198cae;p=emacs.git Rename 'image-dired-db-file' to 'image-dired-tags-db-file' * 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. --- diff --git a/etc/NEWS b/etc/NEWS index 7a573b5e831..d7a6cc60ebb 100644 --- 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 diff --git a/lisp/image/image-dired-tags.el b/lisp/image/image-dired-tags.el index e97bf70e89a..7a837875ce4 100644 --- a/lisp/image/image-dired-tags.el +++ b/lisp/image/image-dired-tags.el @@ -35,34 +35,34 @@ (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)) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index bcff62484fd..1b8b1f1df7b 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -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)