Change write-file to be consistent with the new behavior
of copy-file, etc.
* etc/NEWS: Mention this.
* lisp/files.el (write-file): Treat the destination as special
only if it is a directory name.
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, make-symbolic-link, and rename-file.
+copy-file, format-write-file, make-symbolic-link, rename-file, and
+write-file.
\f
* Lisp Changes in Emacs 26.1
(not current-prefix-arg)))
(or (null filename) (string-equal filename "")
(progn
- ;; If arg is just a directory,
+ ;; If arg is a directory name,
;; use the default file name, but in that directory.
- (if (file-directory-p filename)
- (setq filename (concat (file-name-as-directory filename)
+ (if (directory-name-p filename)
+ (setq filename (concat filename
(file-name-nondirectory
(or buffer-file-name (buffer-name))))))
(and confirm