aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2017-05-06 18:00:23 -0700
committerPaul Eggert2017-05-06 18:05:25 -0700
commitc311b8b15e91dd07e2d23d8d21ebb53d0b5f2204 (patch)
tree3e3166a62f6d8e920d7bbe422b8ffdf99dc7fa21 /src
parent7f3d63908cd05fb34347d942e435c2964cd8b249 (diff)
downloademacs-c311b8b15e91dd07e2d23d8d21ebb53d0b5f2204.tar.gz
emacs-c311b8b15e91dd07e2d23d8d21ebb53d0b5f2204.zip
New var write-region-verbose, default nil
By popular demand, write-region char counts are now off by default (Bug#26796). * src/fileio.c (write-region-verbose): New Lisp var. (write_region): Output char count only if the var is non-nil. * doc/emacs/files.texi (Misc File Ops), etc/NEWS: Document this.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/fileio.c b/src/fileio.c
index ad5ab618b02..6138bfc68bb 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5153,17 +5153,24 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
5153 { 5153 {
5154 EMACS_INT nchars = (STRINGP (start) ? SCHARS (start) 5154 EMACS_INT nchars = (STRINGP (start) ? SCHARS (start)
5155 : XINT (end) - XINT (start)); 5155 : XINT (end) - XINT (start));
5156 AUTO_STRING (format, NUMBERP (append) 5156 AUTO_STRING (format,
5157 ? (nchars != 1 5157 (NUMBERP (append)
5158 ? "Updated `%s' (%d characters)" 5158 ? (NILP (Vwrite_region_verbose)
5159 : "Updated `%s' (%d character)") 5159 ? "Updated `%s'"
5160 : ! NILP (append) 5160 : nchars == 1
5161 ? (nchars != 1 5161 ? "Updated `%s' (1 character)"
5162 ? "Added to `%s' (%d characters)" 5162 : "Updated `%s' (%d characters)")
5163 : "Added to `%s' (%d character)") 5163 : ! NILP (append)
5164 : (nchars != 1 5164 ? (NILP (Vwrite_region_verbose)
5165 ? "Wrote `%s' (%d characters)" 5165 ? "Added to `%s'"
5166 : "Wrote `%s' (%d character)")); 5166 : nchars == 1
5167 ? "Added to `%s' (1 character)"
5168 : "Added to `%s' (%d characters)")
5169 : (NILP (Vwrite_region_verbose)
5170 ? "Wrote `%s'"
5171 : nchars == 1
5172 ? "Wrote `%s' (1 character)"
5173 : "Wrote `%s' (%d characters)")));
5167 CALLN (Fmessage, format, visit_file, make_number (nchars)); 5174 CALLN (Fmessage, format, visit_file, make_number (nchars));
5168 } 5175 }
5169 return Qnil; 5176 return Qnil;
@@ -6135,6 +6142,11 @@ These are the annotations made by other annotation functions
6135that were already called. See also `write-region-annotate-functions'. */); 6142that were already called. See also `write-region-annotate-functions'. */);
6136 Vwrite_region_annotations_so_far = Qnil; 6143 Vwrite_region_annotations_so_far = Qnil;
6137 6144
6145 DEFVAR_LISP ("write-region-verbose",
6146 Vwrite_region_verbose,
6147 doc: /* If non-nil, be more verbose when writing a region. */);
6148 Vwrite_region_verbose = Qnil;
6149
6138 DEFVAR_LISP ("inhibit-file-name-handlers", Vinhibit_file_name_handlers, 6150 DEFVAR_LISP ("inhibit-file-name-handlers", Vinhibit_file_name_handlers,
6139 doc: /* A list of file name handlers that temporarily should not be used. 6151 doc: /* A list of file name handlers that temporarily should not be used.
6140This applies only to the operation `inhibit-file-name-operation'. */); 6152This applies only to the operation `inhibit-file-name-operation'. */);