mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-25 10:47:00 +00:00
Adjust write-region so file name is at the beginning again
* lisp/epa-file.el (epa-file-write-region): * lisp/gnus/mm-util.el (mm-append-to-file): * lisp/jka-compr.el (jka-compr-write-region): * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * src/fileio.c (write_region): Put file name at the beginning and move number of characters to the end of the message.
This commit is contained in:
parent
7582497785
commit
c323659344
@ -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 ()
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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))))
|
||||
|
||||
|
@ -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)))
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
11
src/fileio.c
11
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user