Adjust thumbs to new rename-file behavior
* etc/NEWS: Mention this. * lisp/thumbs.el (thumbs-rename-images): Treat the destination as special only if it is a directory name. When there is a marked list, turn the destination into a directory name if it is not already.
This commit is contained in:
parent
74b8615fcc
commit
2aa0288259
2 changed files with 5 additions and 12 deletions
2
etc/NEWS
2
etc/NEWS
|
@ -1287,7 +1287,7 @@ can be written as (rename-file C (file-name-as-directory D)), a
|
|||
formulation portable to both older and newer versions of Emacs.
|
||||
Affected functions include add-name-to-file, copy-directory,
|
||||
copy-file, format-write-file, gnus-copy-file, make-symbolic-link,
|
||||
rename-file, and write-file.
|
||||
rename-file, thumbs-rename-images, and write-file.
|
||||
|
||||
|
||||
* Lisp Changes in Emacs 26.1
|
||||
|
|
|
@ -523,23 +523,16 @@ Open another window."
|
|||
(interactive "FRename to file or directory: ")
|
||||
(let ((files (or thumbs-marked-list (list (thumbs-current-image))))
|
||||
failures)
|
||||
(if (and (not (file-directory-p newfile))
|
||||
thumbs-marked-list)
|
||||
(if (file-exists-p newfile)
|
||||
(error "Renaming marked files to file name `%s'" newfile)
|
||||
(make-directory newfile t)))
|
||||
(when thumbs-marked-list
|
||||
(make-directory newfile t)
|
||||
(setq newfile (file-name-as-directory newfile)))
|
||||
(if (yes-or-no-p (format "Really rename %d files? " (length files)))
|
||||
(let ((thumbs-file-list (thumbs-file-alist))
|
||||
(inhibit-read-only t))
|
||||
(dolist (file files)
|
||||
(let (failure)
|
||||
(condition-case ()
|
||||
(if (file-directory-p newfile)
|
||||
(rename-file file
|
||||
(expand-file-name
|
||||
(file-name-nondirectory file)
|
||||
newfile))
|
||||
(rename-file file newfile))
|
||||
(rename-file file newfile)
|
||||
(file-error (setq failure t)
|
||||
(push file failures)))
|
||||
(unless failure
|
||||
|
|
Loading…
Add table
Reference in a new issue