From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#26796: 26.0.50; (2 characters) is usually wrong Date: Sat, 6 May 2017 18:11:51 -0700 Organization: UCLA Computer Science Department Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------C3286B05D6C9AFEE22448C0F" X-Trace: blaine.gmane.org 1494119536 16560 195.159.176.226 (7 May 2017 01:12:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 May 2017 01:12:16 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cc: larsi@gnus.org, npostavs@users.sourceforge.net To: 26796@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 07 03:12:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7Ak7-00048T-Ac for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 May 2017 03:12:11 +0200 Original-Received: from localhost ([::1]:53259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7Ak7-000268-RT for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 May 2017 21:12:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7Ak2-0001zN-17 for bug-gnu-emacs@gnu.org; Sat, 06 May 2017 21:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7Ajy-0003nX-TF for bug-gnu-emacs@gnu.org; Sat, 06 May 2017 21:12:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7Ajy-0003nP-Pw for bug-gnu-emacs@gnu.org; Sat, 06 May 2017 21:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d7Ajy-0001C8-CS for bug-gnu-emacs@gnu.org; Sat, 06 May 2017 21:12:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 May 2017 01:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26796 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26796-submit@debbugs.gnu.org id=B26796.14941195204585 (code B ref 26796); Sun, 07 May 2017 01:12:02 +0000 Original-Received: (at 26796) by debbugs.gnu.org; 7 May 2017 01:12:00 +0000 Original-Received: from localhost ([127.0.0.1]:58789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7Ajw-0001Bt-Iw for submit@debbugs.gnu.org; Sat, 06 May 2017 21:12:00 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:49592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7Aju-0001Be-CB for 26796@debbugs.gnu.org; Sat, 06 May 2017 21:11:59 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6AA681600B9; Sat, 6 May 2017 18:11:52 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id hYoQ563wFyCH; Sat, 6 May 2017 18:11:51 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 712741600C1; Sat, 6 May 2017 18:11:51 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bYKL-qwACu_S; Sat, 6 May 2017 18:11:51 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.188.248]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 49CC81600B9; Sat, 6 May 2017 18:11:51 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132326 Archived-At: This is a multi-part message in MIME format. --------------C3286B05D6C9AFEE22448C0F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Appending " (NNNN characters)" to the "Wrote FOO" messages appears to be=20 unpopular and at times confusing. At least it should be off by default, s= o I=20 installed the attached. It'd be fine with me if we removed them entirely. --------------C3286B05D6C9AFEE22448C0F Content-Type: text/x-diff; name="0001-New-var-write-region-verbose-default-nil.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-New-var-write-region-verbose-default-nil.patch" =46rom 33c96bacd656cffeedf32038686c0ea99b7c411b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 6 May 2017 18:00:23 -0700 Subject: [PATCH] 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. --- doc/emacs/files.texi | 7 ++++--- etc/NEWS | 6 +++--- src/fileio.c | 34 +++++++++++++++++++++++----------- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index bc977b7..d36fe65 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1657,9 +1657,10 @@ Misc File Ops copies the contents of the region into the specified file. @kbd{M-x append-to-file} adds the text of the region to the end of the specified file. @xref{Accumulating Text}. When called interactively, -these commands will print a message in the echo area giving the name -of the file affected as well as the number of characters which were -added. The variable @code{write-region-inhibit-fsync} applies to +these commands print a message in the echo area giving the name +of the file affected; if the variable @code{write-region-verbose} is +non-nil the message also reports the number of characters written. +The variable @code{write-region-inhibit-fsync} applies to these commands, as well as saving files; see @ref{Customize Save}. =20 @findex set-file-modes diff --git a/etc/NEWS b/etc/NEWS index 2918c6e..1f1f4b4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -94,9 +94,9 @@ required capabilities are found in terminfo. See the F= AQ node * Changes in Emacs 26.1 =20 +++ -** The functions write-region, append-to-file, and the like now output -the number of characters added in addition to the name of the file -affected. +** The functions write-region, append-to-file, and the like now also +output the number of characters added in addition to the name of the +file affected, if the new variable 'write-region-verbose' is non-nil. =20 ** The variable 'emacs-version' no longer includes the build number. This is now stored separately in a new variable, 'emacs-build-number'. diff --git a/src/fileio.c b/src/fileio.c index ad5ab61..6138bfc 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5153,17 +5153,24 @@ write_region (Lisp_Object start, Lisp_Object end,= Lisp_Object filename, { EMACS_INT nchars =3D (STRINGP (start) ? SCHARS (start) : XINT (end) - XINT (start)); - AUTO_STRING (format, NUMBERP (append) - ? (nchars !=3D 1 - ? "Updated `%s' (%d characters)" - : "Updated `%s' (%d character)") - : ! NILP (append) - ? (nchars !=3D 1 - ? "Added to `%s' (%d characters)" - : "Added to `%s' (%d character)") - : (nchars !=3D 1 - ? "Wrote `%s' (%d characters)" - : "Wrote `%s' (%d character)")); + AUTO_STRING (format, + (NUMBERP (append) + ? (NILP (Vwrite_region_verbose) + ? "Updated `%s'" + : nchars =3D=3D 1 + ? "Updated `%s' (1 character)" + : "Updated `%s' (%d characters)") + : ! NILP (append) + ? (NILP (Vwrite_region_verbose) + ? "Added to `%s'" + : nchars =3D=3D 1 + ? "Added to `%s' (1 character)" + : "Added to `%s' (%d characters)") + : (NILP (Vwrite_region_verbose) + ? "Wrote `%s'" + : nchars =3D=3D 1 + ? "Wrote `%s' (1 character)" + : "Wrote `%s' (%d characters)"))); CALLN (Fmessage, format, visit_file, make_number (nchars)); } return Qnil; @@ -6135,6 +6142,11 @@ These are the annotations made by other annotation= functions that were already called. See also `write-region-annotate-functions'. = */); Vwrite_region_annotations_so_far =3D Qnil; =20 + DEFVAR_LISP ("write-region-verbose", + Vwrite_region_verbose, + doc: /* If non-nil, be more verbose when writing a region. */);= + Vwrite_region_verbose =3D Qnil; + DEFVAR_LISP ("inhibit-file-name-handlers", Vinhibit_file_name_handlers= , doc: /* A list of file name handlers that temporarily should not= be used. This applies only to the operation `inhibit-file-name-operation'. */); --=20 2.7.4 --------------C3286B05D6C9AFEE22448C0F--