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.
\f
* Lisp Changes in Emacs 26.1
(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