From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#354: "Added (how many lines, bytes?!) to file.txt" Date: Tue, 14 Mar 2017 17:55:50 +0200 Message-ID: <83h92vc0op.fsf@gnu.org> References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1489507033 23376 195.159.176.226 (14 Mar 2017 15:57:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Mar 2017 15:57:13 +0000 (UTC) Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 14 16:57:08 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 1cnoot-0005R9-UI for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Mar 2017 16:57:08 +0100 Original-Received: from localhost ([::1]:60294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnooz-0005Fa-SH for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Mar 2017 11:57:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnoos-0005Dy-9k for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2017 11:57:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnooo-0003bW-Cx for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2017 11:57:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57651) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cnooo-0003bK-9b for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2017 11:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cnooo-0005gZ-2z for bug-gnu-emacs@gnu.org; Tue, 14 Mar 2017 11:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Mar 2017 15:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 354 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 354-submit@debbugs.gnu.org id=B354.148950699721822 (code B ref 354); Tue, 14 Mar 2017 15:57:02 +0000 Original-Received: (at 354) by debbugs.gnu.org; 14 Mar 2017 15:56:37 +0000 Original-Received: from localhost ([127.0.0.1]:55850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnooP-0005fu-72 for submit@debbugs.gnu.org; Tue, 14 Mar 2017 11:56:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnooM-0005fg-Ug for 354@debbugs.gnu.org; Tue, 14 Mar 2017 11:56:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnooG-00033d-Pn for 354@debbugs.gnu.org; Tue, 14 Mar 2017 11:56:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnooC-0002zP-7F; Tue, 14 Mar 2017 11:56:24 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4395 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cnooB-0004Id-B5; Tue, 14 Mar 2017 11:56:23 -0400 In-reply-to: <87fuig7jxo.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:130576 Archived-At: > From: npostavs@users.sourceforge.net > Date: Mon, 13 Mar 2017 20:58:59 -0400 > Cc: 354@debbugs.gnu.org, Paul Eggert > > Jeff Clough writes: > > > Updated patch at the end of this message. > > Looks like this patch was forgotten. It still applies cleanly apart > from the NEWS and ChangeLog changes, so I'll push to master in a week or > so if there are no objections. LGTM, with one comment: > diff --git a/src/fileio.c b/src/fileio.c > index acbf76e0d8..bc99ee236c 100644 > --- a/src/fileio.c > +++ b/src/fileio.c > @@ -5150,12 +5150,13 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, > } > > if (!auto_saving && !noninteractive) > - message_with_string ((NUMBERP (append) > - ? "Updated %s" > - : ! NILP (append) > - ? "Added to %s" > - : "Wrote %s"), > - visit_file, 1); > + message ((NUMBERP (append) > + ? "Updated %"pI"d characters of %s" > + : ! NILP (append) > + ? "Added %"pI"d characters to %s" > + : "Wrote %"pI"d characters to %s"), > + XINT (end) - XINT (start), > + SDATA (ENCODE_SYSTEM (visit_file))); It is incorrect to use ENCODE_SYSTEM here: the file name should be output with no changes. That's because 'message' normally displays in the echo area, where the file name should appear unencoded. What is needed here is to pass to 'message' an encoded file name in non-interactive case, and the original one in the interactive case.