diff options
| author | Noam Postavsky | 2017-04-07 19:54:11 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-04-07 19:54:11 -0400 |
| commit | c323659344ba4db7a0b074b2e29d0a5f33d5eb80 (patch) | |
| tree | e7f01af125f1fe89da2214b3b9c0f02a06694308 | |
| parent | 75824977851f27146638672bba4d3789f2a32612 (diff) | |
| download | emacs-c323659344ba4db7a0b074b2e29d0a5f33d5eb80.tar.gz emacs-c323659344ba4db7a0b074b2e29d0a5f33d5eb80.zip | |
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.
| -rw-r--r-- | lisp/epa-file.el | 5 | ||||
| -rw-r--r-- | lisp/gnus/mm-util.el | 2 | ||||
| -rw-r--r-- | lisp/jka-compr.el | 5 | ||||
| -rw-r--r-- | lisp/net/ange-ftp.el | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 5 | ||||
| -rw-r--r-- | src/fileio.c | 11 |
7 files changed, 16 insertions, 22 deletions
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. " | |||
| 290 | (if (or (eq visit t) | 290 | (if (or (eq visit t) |
| 291 | (eq visit nil) | 291 | (eq visit nil) |
| 292 | (stringp visit)) | 292 | (stringp visit)) |
| 293 | (message "Wrote %d characters to `%s'" | 293 | (message "Wrote `%s' (%d characters)" buffer-file-name |
| 294 | (cond ((null start) (buffer-size)) | 294 | (cond ((null start) (buffer-size)) |
| 295 | ((stringp start) (length start)) | 295 | ((stringp start) (length start)) |
| 296 | (t (- end start))) | 296 | (t (- end start))))))) |
| 297 | buffer-file-name)))) | ||
| 298 | (put 'write-region 'epa-file 'epa-file-write-region) | 297 | (put 'write-region 'epa-file 'epa-file-write-region) |
| 299 | 298 | ||
| 300 | (defun epa-file-select-keys () | 299 | (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'." | |||
| 736 | inhibit-file-name-handlers) | 736 | inhibit-file-name-handlers) |
| 737 | inhibit-file-name-handlers))) | 737 | inhibit-file-name-handlers))) |
| 738 | (write-region start end filename t 'no-message) | 738 | (write-region start end filename t 'no-message) |
| 739 | (message "Appended %d characters to `%s'" (- end start) filename))) | 739 | (message "Appended to `%s' (%d characters)" filename (- end start)))) |
| 740 | 740 | ||
| 741 | (defun mm-write-region (start end filename &optional append visit lockname | 741 | (defun mm-write-region (start end filename &optional append visit lockname |
| 742 | coding-system inhibit) | 742 | 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 `/'." | |||
| 357 | (and (or (eq visit t) | 357 | (and (or (eq visit t) |
| 358 | (eq visit nil) | 358 | (eq visit nil) |
| 359 | (stringp visit)) | 359 | (stringp visit)) |
| 360 | (message "Wrote %d characters to `%s'" | 360 | (message "Wrote `%s' (%d characters)" visit-file |
| 361 | (cond ((null start) (buffer-size)) | 361 | (cond ((null start) (buffer-size)) |
| 362 | ((stringp start) (length start)) | 362 | ((stringp start) (length start)) |
| 363 | (t (- end start))) | 363 | (t (- end start))))) |
| 364 | visit-file)) | ||
| 365 | 364 | ||
| 366 | ;; ensure `last-coding-system-used' has an appropriate value | 365 | ;; ensure `last-coding-system-used' has an appropriate value |
| 367 | (setq last-coding-system-used coding-system-used) | 366 | (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.") | |||
| 3284 | (set-buffer-modified-p nil))) | 3284 | (set-buffer-modified-p nil))) |
| 3285 | ;; ensure `last-coding-system-used' has an appropriate value | 3285 | ;; ensure `last-coding-system-used' has an appropriate value |
| 3286 | (setq last-coding-system-used coding-system-used) | 3286 | (setq last-coding-system-used coding-system-used) |
| 3287 | (ange-ftp-message "Wrote %d characters to `%s'" | 3287 | (ange-ftp-message "Wrote `%s' (%d characters)" abbr |
| 3288 | (cond ((null start) (buffer-size)) | 3288 | (cond ((null start) (buffer-size)) |
| 3289 | ((stringp start) (length start)) | 3289 | ((stringp start) (length start)) |
| 3290 | (t (- end start))) | 3290 | (t (- end start)))) |
| 3291 | abbr) | ||
| 3292 | (ange-ftp-add-file-entry filename)) | 3291 | (ange-ftp-add-file-entry filename)) |
| 3293 | (ange-ftp-real-write-region start end filename append visit)))) | 3292 | (ange-ftp-real-write-region start end filename append visit)))) |
| 3294 | 3293 | ||
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." | |||
| 1223 | 1223 | ||
| 1224 | ;; The end. | 1224 | ;; The end. |
| 1225 | (when (or (eq visit t) (null visit) (stringp visit)) | 1225 | (when (or (eq visit t) (null visit) (stringp visit)) |
| 1226 | (tramp-message v 0 "Wrote %d characters to `%s'" | 1226 | (tramp-message v 0 "Wrote `%s' (%d characters)" filename |
| 1227 | (cond ((null start) (buffer-size)) | 1227 | (cond ((null start) (buffer-size)) |
| 1228 | ((stringp start) (length start)) | 1228 | ((stringp start) (length start)) |
| 1229 | (t (- end start))) | 1229 | (t (- end start))))) |
| 1230 | filename)) | ||
| 1231 | (run-hooks 'tramp-handle-write-region-hook))) | 1230 | (run-hooks 'tramp-handle-write-region-hook))) |
| 1232 | 1231 | ||
| 1233 | 1232 | ||
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." | |||
| 3411 | (when need-chown | 3411 | (when need-chown |
| 3412 | (tramp-set-file-uid-gid filename uid gid)) | 3412 | (tramp-set-file-uid-gid filename uid gid)) |
| 3413 | (when (or (eq visit t) (null visit) (stringp visit)) | 3413 | (when (or (eq visit t) (null visit) (stringp visit)) |
| 3414 | (tramp-message v 0 "Wrote %d characters to `%s'" | 3414 | (tramp-message v 0 "Wrote `%s' (%d characters)" filename |
| 3415 | (cond ((null start) (buffer-size)) | 3415 | (cond ((null start) (buffer-size)) |
| 3416 | ((stringp start) (length start)) | 3416 | ((stringp start) (length start)) |
| 3417 | (t (- end start))) | 3417 | (t (- end start))))) |
| 3418 | filename)) | ||
| 3419 | (run-hooks 'tramp-handle-write-region-hook))))) | 3418 | (run-hooks 'tramp-handle-write-region-hook))))) |
| 3420 | 3419 | ||
| 3421 | (defvar tramp-vc-registered-file-names nil | 3420 | (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, | |||
| 5152 | if (!auto_saving && !noninteractive) | 5152 | if (!auto_saving && !noninteractive) |
| 5153 | { | 5153 | { |
| 5154 | AUTO_STRING (format, NUMBERP (append) | 5154 | AUTO_STRING (format, NUMBERP (append) |
| 5155 | ? "Updated %d characters of `%s'" | 5155 | ? "Updated `%s' (%d characters)" |
| 5156 | : ! NILP (append) | 5156 | : ! NILP (append) |
| 5157 | ? "Added %d characters to `%s'" | 5157 | ? "Added to `%s' (%d characters)" |
| 5158 | : "Wrote %d characters to `%s'"); | 5158 | : "Wrote `%s' (%d characters)"); |
| 5159 | CALLN (Fmessage, format, | 5159 | CALLN (Fmessage, format, visit_file, |
| 5160 | (STRINGP (start) ? Flength (start) | 5160 | (STRINGP (start) ? Flength (start) |
| 5161 | : make_number (XINT (end) - XINT (start))), | 5161 | : make_number (XINT (end) - XINT (start)))); |
| 5162 | visit_file); | ||
| 5163 | } | 5162 | } |
| 5164 | return Qnil; | 5163 | return Qnil; |
| 5165 | } | 5164 | } |