diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 2e06c8374ff..64e00e0aba4 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -290,11 +290,10 @@ If no one is selected, symmetric encryption will be performed. " (if (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %d characters to `%s'" + (message "Wrote `%s' (%d characters)" buffer-file-name (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - buffer-file-name)))) + (t (- end start))))))) (put 'write-region 'epa-file 'epa-file-write-region) (defun epa-file-select-keys () diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index f0dc803eddc..f4e79e53731 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -736,7 +736,7 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'." inhibit-file-name-handlers) inhibit-file-name-handlers))) (write-region start end filename t 'no-message) - (message "Appended %d characters to `%s'" (- end start) filename))) + (message "Appended to `%s' (%d characters)" filename (- end start)))) (defun mm-write-region (start end filename &optional append visit lockname coding-system inhibit) diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index a5e24a6f9ac..e4f7348c81a 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -357,11 +357,10 @@ There should be no more than seven characters after the final `/'." (and (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %d characters to `%s'" + (message "Wrote `%s' (%d characters)" visit-file (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - visit-file)) + (t (- end start))))) ;; ensure `last-coding-system-used' has an appropriate value (setq last-coding-system-used coding-system-used) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 6e84269e308..cd0ae8d4203 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3284,11 +3284,10 @@ system TYPE.") (set-buffer-modified-p nil))) ;; ensure `last-coding-system-used' has an appropriate value (setq last-coding-system-used coding-system-used) - (ange-ftp-message "Wrote %d characters to `%s'" + (ange-ftp-message "Wrote `%s' (%d characters)" abbr (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - abbr) + (t (- end start)))) (ange-ftp-add-file-entry filename)) (ange-ftp-real-write-region start end filename append visit)))) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index b7477271d70..593be33e833 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1223,11 +1223,10 @@ file-notify events." ;; The end. (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %d characters to `%s'" + (tramp-message v 0 "Wrote `%s' (%d characters)" filename (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - filename)) + (t (- end start))))) (run-hooks 'tramp-handle-write-region-hook))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index a8556b9a0d0..475f2b9a5d1 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3411,11 +3411,10 @@ the result will be a local, non-Tramp, file name." (when need-chown (tramp-set-file-uid-gid filename uid gid)) (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %d characters to `%s'" + (tramp-message v 0 "Wrote `%s' (%d characters)" filename (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - filename)) + (t (- end start))))) (run-hooks 'tramp-handle-write-region-hook))))) (defvar tramp-vc-registered-file-names nil diff --git a/src/fileio.c b/src/fileio.c index 567f56c9063..fc853f26673 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5152,14 +5152,13 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, if (!auto_saving && !noninteractive) { AUTO_STRING (format, NUMBERP (append) - ? "Updated %d characters of `%s'" + ? "Updated `%s' (%d characters)" : ! NILP (append) - ? "Added %d characters to `%s'" - : "Wrote %d characters to `%s'"); - CALLN (Fmessage, format, + ? "Added to `%s' (%d characters)" + : "Wrote `%s' (%d characters)"); + CALLN (Fmessage, format, visit_file, (STRINGP (start) ? Flength (start) - : make_number (XINT (end) - XINT (start))), - visit_file); + : make_number (XINT (end) - XINT (start)))); } return Qnil; }