emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c323659: Adjust write-region so file name is at the


From: Noam Postavsky
Subject: [Emacs-diffs] master c323659: Adjust write-region so file name is at the beginning again
Date: Fri, 7 Apr 2017 20:04:12 -0400 (EDT)

branch: master
commit c323659344ba4db7a0b074b2e29d0a5f33d5eb80
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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.
---
 lisp/epa-file.el       |  5 ++---
 lisp/gnus/mm-util.el   |  2 +-
 lisp/jka-compr.el      |  5 ++---
 lisp/net/ange-ftp.el   |  5 ++---
 lisp/net/tramp-gvfs.el |  5 ++---
 lisp/net/tramp-sh.el   |  5 ++---
 src/fileio.c           | 11 +++++------
 7 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index 2e06c83..64e00e0 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 f0dc803..f4e79e5 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 a5e24a6..e4f7348 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 6e84269..cd0ae8d 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 b747727..593be33 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 a8556b9..475f2b9 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 567f56c..fc853f2 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;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]