From jidanni@jidanni.org Tue Jun 3 13:22:38 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.2 required=4.0 tests=AWL,BAYES_00,PLING_QUERY, RCVD_IN_DNSWL_LOW autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Jun 2008 20:22:39 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m53KMZe4024791 for ; Tue, 3 Jun 2008 13:22:36 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3d1f-0002ih-4b for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 16:22:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3d1d-0002gC-Kb for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 16:22:33 -0400 Received: from [199.232.76.173] (port=32966 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3d1d-0002fg-EW for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 16:22:33 -0400 Received: from lax-green-bigip-5.dreamhost.com ([208.113.200.5]:49842 helo=blingymail-a2.g.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3d1c-0005r6-4o for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 16:22:33 -0400 Received: from jidanni1.jidanni.org (122-127-33-182.dynamic.hinet.net [122.127.33.182]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by blingymail-a2.g.dreamhost.com (Postfix) with ESMTP id 5E7204134B for ; Tue, 3 Jun 2008 13:22:30 -0700 (PDT) To: bug-gnu-emacs@gnu.org Subject: "Added (how many lines, bytes?!) to file.txt" From: jidanni@jidanni.org Date: Wed, 04 Jun 2008 02:37:52 +0800 Message-ID: <87r6bemkjj.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 Gentlemen, (I sound like Prince's "Partyman" song) I noticed all append-to-file says is "Added to /var/neurdsbeurg.txt". The problem is often the user thinks "good, thanks", when days later he discovers few or no lines got added, that's right, even 0 bytes will produce the same message. You see often we are not fully aware of the extent of our regions, colored or not, especially when extending off the screen. Therefore I propose you change that message to say instead how many line or bytes or characters or both or all three were copied over. All this of course also applies to write-region. From monnier@iro.umontreal.ca Tue Jun 3 14:07:57 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, HELO_LH_HOME,MURPHY_DRUGS_REL8,PLING_QUERY,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 354) by emacsbugs.donarmstrong.com; 3 Jun 2008 21:07:57 +0000 Received: from ceviche.home (206-248-132-168.dsl.teksavvy.com [206.248.132.168]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m53L7sDu003835 for <354@emacsbugs.donarmstrong.com>; Tue, 3 Jun 2008 14:07:55 -0700 Received: by ceviche.home (Postfix, from userid 20848) id 27C19B423C; Tue, 3 Jun 2008 17:07:53 -0400 (EDT) From: Stefan Monnier To: 354@debbugs.gnu.org Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" Message-ID: References: <87r6bemkjj.fsf@jidanni.org> Date: Tue, 03 Jun 2008 17:07:53 -0400 In-Reply-To: <87r6bemkjj.fsf@jidanni.org> (jidanni@jidanni.org's message of "Wed, 04 Jun 2008 02:37:52 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii severity 354 wishitem thanks > Gentlemen, (I sound like Prince's "Partyman" song) > I noticed all append-to-file says is > "Added to /var/neurdsbeurg.txt". > The problem is often the user thinks "good, thanks", when days later > he discovers few or no lines got added, that's right, even 0 bytes > will produce the same message. You see often we are not fully aware of > the extent of our regions, colored or not, especially when extending > off the screen. > Therefore I propose you change that message to say instead how many > line or bytes or characters or both or all three were copied over. That sounds like a good idea. I think you may even be able to provide a patch for it. The relevant code is at the very end of the Fwrite_region function in emacs/src/fileio.c. Stefan From monnier@iro.umontreal.ca Tue Jun 3 17:09:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=0.4 required=4.0 tests=AWL,BAYES_00,HELO_LH_HOME, ONEWORD,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,VALID_BTS_CONTROL autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at control) by emacsbugs.donarmstrong.com; 4 Jun 2008 00:09:06 +0000 Received: from ceviche.home (206-248-132-168.dsl.teksavvy.com [206.248.132.168]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m540924t015859 for ; Tue, 3 Jun 2008 17:09:04 -0700 Received: by ceviche.home (Postfix, from userid 20848) id C873CB423C; Tue, 3 Jun 2008 20:09:01 -0400 (EDT) From: Stefan Monnier To: control@debbugs.gnu.org Subject: Re: asd Message-ID: References: Date: Tue, 03 Jun 2008 20:09:01 -0400 In-Reply-To: (Stefan Monnier's message of "Tue, 03 Jun 2008 17:10:50 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii severity 352 wishlist severity 353 wishlist severity 354 wishlist thanks From geb-bug-gnu-emacs@m.gmane.org Thu Jun 5 21:02:28 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.3 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, PLING_QUERY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Jun 2008 04:02:28 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5642NZI004264 for ; Thu, 5 Jun 2008 21:02:25 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K4T9i-0001AY-NW for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 00:02:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K4T9i-0001AM-5e for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 00:02:22 -0400 Received: from [199.232.76.173] (port=55857 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4T9i-0001AJ-2t for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 00:02:22 -0400 Received: from main.gmane.org ([80.91.229.2]:59974 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K4T9i-0006qz-1R for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 00:02:22 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1K4T9e-00015j-0A for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 04:02:18 +0000 Received: from c-67-190-29-163.hsd1.co.comcast.net ([67.190.29.163]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Jun 2008 04:02:17 +0000 Received: from kevin.d.rodgers by c-67-190-29-163.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Jun 2008 04:02:17 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Kevin Rodgers Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" Date: Thu, 05 Jun 2008 22:02:08 -0600 Lines: 22 Message-ID: References: <87r6bemkjj.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-67-190-29-163.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) In-Reply-To: <87r6bemkjj.fsf@jidanni.org> Sender: news X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) jidanni@jidanni.org wrote: > Gentlemen, (I sound like Prince's "Partyman" song) > I noticed all append-to-file says is > "Added to /var/neurdsbeurg.txt". > > The problem is often the user thinks "good, thanks", when days later > he discovers few or no lines got added, that's right, even 0 bytes > will produce the same message. You see often we are not fully aware of > the extent of our regions, colored or not, especially when extending > off the screen. > > Therefore I propose you change that message to say instead how many > line or bytes or characters or both or all three were copied over. Since append-to-file takes buffer positions as arguments, I think the most relevant unit to report would be characters. > All this of course also applies to write-region. -- Kevin Rodgers Denver, Colorado, USA From drew.adams@oracle.com Fri Jun 6 07:57:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.7 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, PLING_QUERY,RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Jun 2008 14:57:48 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m56EvfvP003689 for ; Fri, 6 Jun 2008 07:57:42 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K4dNt-0005Au-98 for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 10:57:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K4dNr-0005AB-RI for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 10:57:40 -0400 Received: from [199.232.76.173] (port=47959 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4dNr-0005A6-I0 for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 10:57:39 -0400 Received: from rgminet01.oracle.com ([148.87.113.118]:36861) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K4dNr-0006aD-84 for bug-gnu-emacs@gnu.org; Fri, 06 Jun 2008 10:57:39 -0400 Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m56EvQOh004947; Fri, 6 Jun 2008 08:57:26 -0600 Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m55C6rnG032664; Fri, 6 Jun 2008 08:57:25 -0600 Received: from inet-141-146-46-1.oracle.com by acsmt350.oracle.com with ESMTP id 3688085841212764176; Fri, 06 Jun 2008 07:56:16 -0700 Received: from dradamslap1 (/24.5.171.3) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 06 Jun 2008 07:56:15 -0700 From: "Drew Adams" To: "'Kevin Rodgers'" , <354@debbugs.gnu.org>, References: <87r6bemkjj.fsf@jidanni.org> Subject: RE: bug#354: "Added (how many lines, bytes?!) to file.txt" Date: Fri, 6 Jun 2008 07:56:14 -0700 Message-ID: <001f01c8c7e5$77c0c760$0200a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-reply-to: THREAD-INDEX: AcjH4woKBC1ts5sHQsKmGFu4Cl5NBwAAhvkg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-CrossAssassin-Score: 2 > Since append-to-file takes buffer positions as arguments, I think > the most relevant unit to report would be characters. Definitely. Both could be mentioned, however: (2614 chars, 104 lines). From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 02:21:16 2015 Received: (at 354) by debbugs.gnu.org; 27 Feb 2015 07:21:16 +0000 Received: from localhost ([127.0.0.1]:59213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRFEZ-0007Y4-Na for submit@debbugs.gnu.org; Fri, 27 Feb 2015 02:21:16 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:34086) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRFEW-0007Xq-Ro for 354@debbugs.gnu.org; Fri, 27 Feb 2015 02:21:13 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 4C2EE39E801F; Thu, 26 Feb 2015 23:21:07 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tr7mrwd-1IeS; Thu, 26 Feb 2015 23:21:06 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9026739E801D; Thu, 26 Feb 2015 23:21:06 -0800 (PST) Message-ID: <54F01AE2.8050406@cs.ucla.edu> Date: Thu, 26 Feb 2015 23:21:06 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jeff Clough Subject: Re: "Added (how many lines, bytes?!) to file.txt" Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) Following up to: http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg01364.html Jeff Clough wrote: > 1. git checkout master > 2. git pull > 3. git checkout -b wishlist-354 (is this overkill for a small change?) No, it's what I do. > 4. Changed write-region in "fileio.c" > 5. Tested my change (is building in place advised?) It's what I do. Some people prefer building in another directory. > 6. Created "wishlist354log.txt" with my commit message > 7. git commit -a -F /path/to/wishlist354log.txt For now, you need a ChangeLog entry in src/ChangeLog too; it's essentially a copy of the commit message. On my list of things to do is simplifying this. > 8. git format-patch -1 (is using this advised?) Yes, it's good. > Changed write-region to show characters added in message This should be a proper ChangeLog message, e.g., by adding a 2nd line "* fileio.c (write_region): description". > + message ((NUMBERP (append) > + ? "Updated %d characters of %s" > + : ! NILP (append) > + ? "Added %d characters to %s" > + : "Wrote %d characters to %s"), > + (int) (XINT (end) - XINT (start)), > + SDATA (ENCODE_SYSTEM (visit_file))); This won't work on platforms where EMACS_INT is wider than int. Use the pI macro instead, and don't cast to 'int'. Also, you need to change the documentation of this stuff in doc/emacs/files.texi, and add a news item in etc/NEWS. Plus, you need to change epa-file-write-region, jka-compr-write-region, etc. to be compatible. And there's probably more stuff. I suggest running this shell command: grep -nH -re 'Wrote ' $(git ls-files) and checking every matching line. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 11:57:59 2015 Received: (at 354) by debbugs.gnu.org; 27 Feb 2015 16:57:59 +0000 Received: from localhost ([127.0.0.1]:60144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YROEf-0007Mb-Sm for submit@debbugs.gnu.org; Fri, 27 Feb 2015 11:57:58 -0500 Received: from mail-qc0-f182.google.com ([209.85.216.182]:44420) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRLL4-0002vt-Di for 354@debbugs.gnu.org; Fri, 27 Feb 2015 08:52:23 -0500 Received: by qcvs11 with SMTP id s11so13859817qcv.11 for <354@debbugs.gnu.org>; Fri, 27 Feb 2015 05:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ksC26xxHdcY6nnBSHR7ykQzwIN+yNs18TW23GUJBxxI=; b=XfROAiwRXnybKjnVHC/aa0Yx0CHEmEsrLEbOlUxH97uya9wbBRemFQ+nJHSYIBzqnc cjvk8srZVmETGR1kWiNg59Ayz3XtPWE6KBvD2eExBDyhZwjOLdM88f0P6mB/0rWbcfAF wSisDfcN6zCsuFypNIZFumx0LjHNRVXqca+8YIAvJ2jEI4cVLPK3uq483cc6FOffqohL /+qv3LvRDKJIn7Sqvcrl0+tS6uwKsy4kL3+IuAS8f7QkwHPDy+ewAFTCtbm71K8XVfpk HDufoscZ/6k0RlMasalsGzibgaep5YpH0AgTxQF58hwm1+V3p9LwCqUAjsDhCX4/6NdK 38DA== X-Received: by 10.229.114.74 with SMTP id d10mr29424825qcq.5.1425045136736; Fri, 27 Feb 2015 05:52:16 -0800 (PST) Received: from jeff-Inspiron-3537 (cpe-74-69-219-28.maine.res.rr.com. [74.69.219.28]) by mx.google.com with ESMTPSA id b14sm2631896qaq.46.2015.02.27.05.52.13 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Feb 2015 05:52:15 -0800 (PST) From: Jeff Clough To: Paul Eggert Subject: Re: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> Date: Fri, 27 Feb 2015 08:52:12 -0500 In-Reply-To: <54F01AE2.8050406@cs.ucla.edu> (Paul Eggert's message of "Thu, 26 Feb 2015 23:21:06 -0800") Message-ID: <87y4njzckz.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 354 X-Mailman-Approved-At: Fri, 27 Feb 2015 11:57:57 -0500 Cc: 354@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Updated patch at the end of this message. Thank you very much for your help on this, Paul. The changes needed proved somewhat more pervasive than I'd first thought, but that's always the case, isn't. :) I *believe* I got them all, searching for "Wrote " and every synonym I could think of. I also updated the documentation for write-region and append-to-file (to which the docs of the other functions all seem to refer), created a ChangeLog entry, and updated NEWS. On this last, I was uncertain where to place the entry, but think (hope?) I got it right. Also, I understand that there's some copyright assignment paperwork I need to fill out and sign for non-trivial changes. I will start that process now, but hope this change can be accepted in the interim. Finally, is it still advisable to make a single patch for a small change such as this, even when it affects so many files? Thanks again. Jeff [PATCH] Changed write-region and the like to show characters added in message * fileio.c (write_region): * epa-file.el (epa-file-write-region): * jka-compr.el (jka-compr-write-region): * ange-ftp.el (ange-ftp-write-region): * tramp-gvfs.el (tramp-gvfs-handle-write-region): * tramp-sh.el (tramp-sh-handle-write-region): * mm-util.el (mm-append-to-file): Functions now output characters written in addition to file name. * files.texi: Added documentation to write-region and append-to-file describing their output. Fixes: debbugs:354 --- doc/emacs/files.texi | 2 +- etc/NEWS | 3 +++ lisp/epa-file.el | 2 +- lisp/gnus/mm-util.el | 2 +- lisp/jka-compr.el | 2 +- lisp/net/ange-ftp.el | 2 +- lisp/net/tramp-gvfs.el | 2 +- lisp/net/tramp-sh.el | 2 +- src/ChangeLog | 13 +++++++++++++ src/fileio.c | 13 +++++++------ 10 files changed, 30 insertions(+), 13 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index b12b28f..7ed44de 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1621,7 +1621,7 @@ similar to the @kbd{M-x find-file-literally} command @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it 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}. The variable +specified file. 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. @xref{Accumulating Text}. The variable @code{write-region-inhibit-fsync} applies to these commands, as well as saving files; see @ref{Customize Save}. diff --git a/etc/NEWS b/etc/NEWS index 3f88d3d..bd569a8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -66,6 +66,9 @@ so if you want to use it, you can always take a copy from an older Emacs. * Changes in Emacs 25.1 ++++ +** 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. + ** New command `comment-line' bound to `C-x C-;'. ** New function `custom-prompt-customize-unsaved-options' checks for diff --git a/lisp/epa-file.el b/lisp/epa-file.el index db8613a..4cce256 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -286,7 +286,7 @@ If no one is selected, symmetric encryption will be performed. " (if (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %s" buffer-file-name)))) + (message "Wrote %d characters to %s" (- end start) buffer-file-name)))) (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 0b75901..13cc9f5 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -1352,7 +1352,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 to %s" filename))) + (message "Appended %d characters to %s" (- end start) filename))) (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 fced4ee..5530b86 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -357,7 +357,7 @@ There should be no more than seven characters after the final `/'." (and (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %s" visit-file)) + (message "Wrote %d characters to %s" (- end start) visit-file)) ;; 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 52153ad..588778d 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3285,7 +3285,7 @@ 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 %s" abbr) + (ange-ftp-message "Wrote %d characters to %s" (- end start) abbr) (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 1ea52eb..a4f8d0a 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1105,7 +1105,7 @@ is no information where to trace the message.") ;; The end. (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %s" filename)) + (tramp-message v 0 "Wrote %d characters to %s" (- end start) filename)) (run-hooks 'tramp-handle-write-region-hook))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f3fdb63..e385cfa 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3429,7 +3429,7 @@ 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 %s" filename)) + (tramp-message v 0 "Wrote %d characters to %s" (- end start) filename)) (run-hooks 'tramp-handle-write-region-hook))))) (defvar tramp-vc-registered-file-names nil diff --git a/src/ChangeLog b/src/ChangeLog index 61bb32164..d476ac8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2015-02-27 Jeff Clough + + * fileio.c (write_region): + * epa-file.el (epa-file-write-region): + * jka-compr.el (jka-compr-write-region): + * ange-ftp.el (ange-ftp-write-region): + * tramp-gvfs.el (tramp-gvfs-handle-write-region): + * tramp-sh.el (tramp-sh-handle-write-region): + * mm-util.el (mm-append-to-file): Functions now output + characters written in addition to file name. + * files.texi: Added documentation to write-region and + append-to-file describing their output. + 2015-02-27 Mark Laws Support daemon mode on MS-Windows (bug#19688) diff --git a/src/fileio.c b/src/fileio.c index 43ab456..da526c6 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5000,12 +5000,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))); return Qnil; } -- 1.9.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 13 20:57:50 2017 Received: (at 354) by debbugs.gnu.org; 14 Mar 2017 00:57:50 +0000 Received: from localhost ([127.0.0.1]:54513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnamc-0007eY-Go for submit@debbugs.gnu.org; Mon, 13 Mar 2017 20:57:50 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:34569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnamZ-0007eE-Up; Mon, 13 Mar 2017 20:57:48 -0400 Received: by mail-io0-f194.google.com with SMTP id n76so15000564ioe.1; Mon, 13 Mar 2017 17:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=pDTGdWqosjxWAUChYdnq71f0qCyiBB8UpXPtvES2C0s=; b=JFL952970mdNde0diggOAqKxvyT81+S5RZiiwdFRR3W0eYaKvZxbGzal1CNDYMtnyR PRMBOi4mNbjYxL8d9GVArvHVFAkb/bNSZLLhJWTyz4KW9UmyESxa+K/q7LdwL7tE0IH0 9urffJ0n6Qub+gPdL4kMtiASc6P0mqhHYp4MWLuS1jXTxgagXvGRF9MTNicOo8YPVuZh y8SvXX4FYzytwSuBRpBFaZ7HXFYY4OPp6jB3HYBnVUBfpiHrUXyyzoKdQHL3URP5WNLQ 2EPe8eU+8eZJgDzZ4jbsxJnpnpo7fy531mXwXwAmxSOHkwr/tMZ/tTJxlJmnDm6eBikB 48gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=pDTGdWqosjxWAUChYdnq71f0qCyiBB8UpXPtvES2C0s=; b=b5ExB8D1HAk6eRInpoqOvQm/yOPCAHHbzhPa3B2MrTdimn9jugRz2vKja4rGcjqD3j geANZUKAum60RWVl7PaCgb1XJ4yejgm+380tOCTWBZtSILtZhoS1o0Yg++xc5mLDe9Eu jCCE1S9YquSIAum0RLprewjMiA+m0TO4/HhouqcZKYFl2XERYL5N6rzZP5equjuqNr8q qXXiQQ4ZtsKWkUc/jB3YYMDKzZUSHs1EOLd8gffoX2O9QurvxTHOBch6TOVNpi7Pp7t5 KFNKc2a2KxMs/Z3KF5dt38nNscSBf0tzm05mzAXM041ypDN0F0Yk/Mr5VyUONkhgP5R0 q4jA== X-Gm-Message-State: AMke39kJQtayFbSO9Ov8tSTXWfYVqciXbEHmG0jhM7DtPG96qqX1t3pww+GGVmif2YO8MA== X-Received: by 10.107.156.197 with SMTP id f188mr31772788ioe.9.1489453062428; Mon, 13 Mar 2017 17:57:42 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e79sm4418251ite.23.2017.03.13.17.57.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Mar 2017 17:57:41 -0700 (PDT) From: npostavs@users.sourceforge.net To: Jeff Clough Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> Date: Mon, 13 Mar 2017 20:58:59 -0400 In-Reply-To: <87y4njzckz.fsf@gmail.com> (Jeff Clough's message of "Fri, 27 Feb 2015 08:52:12 -0500") Message-ID: <87fuig7jxo.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain tags 354 patch quit 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. Reformatted with git format-patch (I made a few whitespace changes to the patch as well). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Output-number-of-characters-added-to-file-Bug-354.patch Content-Description: patch >From fd1c97f4d9f417d4ded4ec40b52daac70f15137c Mon Sep 17 00:00:00 2001 From: Jeff Clough Date: Fri, 27 Feb 2015 08:52:12 -0500 Subject: [PATCH] Output number of characters added to file (Bug#354) * fileio.c (write_region): * epa-file.el (epa-file-write-region): * jka-compr.el (jka-compr-write-region): * ange-ftp.el (ange-ftp-write-region): * tramp-gvfs.el (tramp-gvfs-handle-write-region): * tramp-sh.el (tramp-sh-handle-write-region): * mm-util.el (mm-append-to-file): Functions now output characters written in addition to file name. * files.texi: Added documentation to write-region and append-to-file describing their output. --- doc/emacs/files.texi | 8 +++++--- etc/NEWS | 5 +++++ lisp/epa-file.el | 2 +- lisp/gnus/mm-util.el | 2 +- lisp/jka-compr.el | 2 +- lisp/net/ange-ftp.el | 2 +- lisp/net/tramp-gvfs.el | 2 +- lisp/net/tramp-sh.el | 3 ++- src/fileio.c | 13 +++++++------ 9 files changed, 24 insertions(+), 15 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 2b09c69945..d3116730ee 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1639,9 +1639,11 @@ Misc File Ops @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it 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}. The variable -@code{write-region-inhibit-fsync} applies to these commands, as well -as saving files; see @ref{Customize Save}. +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, as well as saving files; see @ref{Customize Save}. @findex set-file-modes @cindex file modes diff --git a/etc/NEWS b/etc/NEWS index fde18ed391..d83572958b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -91,6 +91,11 @@ required capabilities are found in terminfo. See the FAQ node * Changes in Emacs 26.1 ++++ +** 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 variable 'emacs-version' no longer includes the build number. This is now stored separately in a new variable, 'emacs-build-number'. diff --git a/lisp/epa-file.el b/lisp/epa-file.el index c97acb837a..bc97992b5f 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -290,7 +290,7 @@ epa-file-write-region (if (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %s" buffer-file-name)))) + (message "Wrote %d characters to %s" (- end start) buffer-file-name)))) (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 89f397e3ed..5a58ed15b9 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -736,7 +736,7 @@ mm-append-to-file inhibit-file-name-handlers) inhibit-file-name-handlers))) (write-region start end filename t 'no-message) - (message "Appended to %s" filename))) + (message "Appended %d characters to %s" (- end start) filename))) (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 26a7cf506f..0be349f0fd 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -357,7 +357,7 @@ jka-compr-write-region (and (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %s" visit-file)) + (message "Wrote %d characters to %s" (- end start) visit-file)) ;; 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 cafdb3ecb0..54ffa3551f 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3284,7 +3284,7 @@ ange-ftp-write-region (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 %s" abbr) + (ange-ftp-message "Wrote %d characters to %s" (- end start) abbr) (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 dd42d9c983..0a952dcca1 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1224,7 +1224,7 @@ tramp-gvfs-handle-write-region ;; The end. (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %s" filename)) + (tramp-message v 0 "Wrote %d characters to %s" (- end start) filename)) (run-hooks 'tramp-handle-write-region-hook))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 6cd52ae4e0..d1ef1448bb 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3414,7 +3414,8 @@ tramp-sh-handle-write-region (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 %s" filename)) + (tramp-message v 0 "Wrote %d characters to %s" + (- end start) filename)) (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 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))); return Qnil; } -- 2.11.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 14 11:56:37 2017 Received: (at 354) by debbugs.gnu.org; 14 Mar 2017 15:56:37 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,PLING_QUERY, RP_MATCHES_RCVD autolearn=disabled version=3.3.2 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 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 Date: Tue, 14 Mar 2017 17:55:50 +0200 Message-Id: <83h92vc0op.fsf@gnu.org> From: Eli Zaretskii To: npostavs@users.sourceforge.net In-reply-to: <87fuig7jxo.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -4.7 (----) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.7 (----) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 01 00:26:26 2017 Received: (at 354) by debbugs.gnu.org; 1 Apr 2017 04:26:26 +0000 Received: from localhost ([127.0.0.1]:54944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuAcM-0007cZ-FL for submit@debbugs.gnu.org; Sat, 01 Apr 2017 00:26:26 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:36178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuAcK-0007cI-G1 for 354@debbugs.gnu.org; Sat, 01 Apr 2017 00:26:24 -0400 Received: by mail-it0-f65.google.com with SMTP id 190so3775371itm.3 for <354@debbugs.gnu.org>; Fri, 31 Mar 2017 21:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XXQMVfP4On0eo4t1h/DKD3i6l7z1MKzOodlGUWNhHkI=; b=itlv+aKhmMefhKaJWeKuRDy55YFHJD23qwAOeUfC1wFHu8Ffy1Cik6j+H93FtlDziS r8WAj0oCvK+4ebxYW5IY5jSjq2fjhgMk+OUJFHsrMebIBmqXFuRdJ3sr86+QHPMoIAQ6 OKSVfuzQ5nsGYe2Mk0N+0ZUiCXlB2Kx+w0zMUyB3aotygEDNylb8azVpGWltmTl96fpJ Sx7rrs4vQ59J+2mSdDMglgW2clg6xx1oDR9iLZP+OoFiEjmISWLwzKY5IFIOPDe6H7tI Fl+qLfY+nky/nJQ7K8iUwVxqBp/Rhspgepm1VdDbo67Wvw/Hnia0fGYklokWRp5RdGJ+ CDYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=XXQMVfP4On0eo4t1h/DKD3i6l7z1MKzOodlGUWNhHkI=; b=r8z5INUtAZZ4JQRMJy365nxLEuR4wcnRieNWxEs5FyfUBe8k9QRZoYnQde8ufbiZ7G /cMyOdR2GlqcpJ6DkXMuN9Sl56Lzt3uuUxnwDY9Y909YJ1KNFhRJbnp86CpaIWZiA/kF e+DbxiazqmkEbrTuSHNMUMwwc9WWzv3JWjq2YOPSzT64Lj5QGUfe21DkxpmCKD+JWs3h fifBbpYl5TKCHHCcRRS80Cn5LCzA72+djilmdkTHvdK9P4xu8ZLWkkYyBtkgrBDkDPDh R6v0L5vJfctYvoEMcAntC7scgEhcipLyubeTj/Mz5rbJLjZDkiYEqJs+tyy1fqDQJt1a PYlA== X-Gm-Message-State: AFeK/H1pqb2nLvYmNewrMPzYT+dIGj+PZBRJPTR87QfrBd900V4M22vd1olmcz66gIpInw== X-Received: by 10.36.51.18 with SMTP id k18mr1253631itk.41.1491020778855; Fri, 31 Mar 2017 21:26:18 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id y21sm4320052ioi.0.2017.03.31.21.26.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 Mar 2017 21:26:18 -0700 (PDT) From: npostavs@users.sourceforge.net To: Eli Zaretskii Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> Date: Sat, 01 Apr 2017 00:27:40 -0400 In-Reply-To: <83h92vc0op.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 14 Mar 2017 17:55:50 +0200") Message-ID: <87mvc021mr.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Eli Zaretskii writes: >> --- 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. Actually, we don't print anything in the non-interactive case, so there is no need to worry about that. But I guess the problem here is this comment on vmessage: The message must be safe ASCII and the format must not contain ` or '. If your message and format do not fit into this category, convert your arguments to Lisp objects and use Fmessage instead. */ This applies to message as well, correct? (I suppose it must, since message does nothing but call vmessage.) So we need to use Fmessage to be able to print the file name. Like this? if (!auto_saving && !noninteractive) Fmessage (build_string ("%s %d characters of %s"), build_string (NUMBERP (append) ? "Updated" : ! NILP (append) ? "Added" : "Wrote"), make_number (XINT (end) - XINT (start)), visit_file); From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 01 02:09:25 2017 Received: (at 354) by debbugs.gnu.org; 1 Apr 2017 06:09:25 +0000 Received: from localhost ([127.0.0.1]:54962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuCE1-0001qX-Lc for submit@debbugs.gnu.org; Sat, 01 Apr 2017 02:09:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuCDz-0001q2-EP for 354@debbugs.gnu.org; Sat, 01 Apr 2017 02:09:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuCDo-00038l-Og for 354@debbugs.gnu.org; Sat, 01 Apr 2017 02:09:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_20,PLING_QUERY, RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuCDd-0002yK-W0; Sat, 01 Apr 2017 02:09:02 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4396 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cuCDc-0000bJ-Hx; Sat, 01 Apr 2017 02:09:01 -0400 Date: Sat, 01 Apr 2017 09:09:04 +0300 Message-Id: <83zig04q2n.fsf@gnu.org> From: Eli Zaretskii To: npostavs@users.sourceforge.net In-reply-to: <87mvc021mr.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -4.7 (----) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.7 (----) > From: npostavs@users.sourceforge.net > Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu > Date: Sat, 01 Apr 2017 00:27:40 -0400 > > >> + 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. > > Actually, we don't print anything in the non-interactive case, so there > is no need to worry about that. But I guess the problem here is this > comment on vmessage: > > The message must be safe ASCII and the format must not contain ` or > '. If your message and format do not fit into this category, > convert your arguments to Lisp objects and use Fmessage instead. */ > > This applies to message as well, correct? Yes, but only because of the non-interactive case. If that is not an issue, you could simply pass the SDATA of the original string, because we simply insert that into an echo-area buffer. It might be a good idea to have a similar comment to 'message'. > So we need to use Fmessage to be able to print the file name. Like > this? > > if (!auto_saving && !noninteractive) > Fmessage (build_string ("%s %d characters of %s"), > build_string (NUMBERP (append) ? "Updated" > : ! NILP (append) ? "Added" > : "Wrote"), > make_number (XINT (end) - XINT (start)), > visit_file); Yes, this is also okay. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 01 23:54:38 2017 Received: (at 354) by debbugs.gnu.org; 2 Apr 2017 03:54:38 +0000 Received: from localhost ([127.0.0.1]:56273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuWb8-0002Km-Fn for submit@debbugs.gnu.org; Sat, 01 Apr 2017 23:54:38 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:35445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuWb6-0002KX-Ia for 354@debbugs.gnu.org; Sat, 01 Apr 2017 23:54:37 -0400 Received: by mail-io0-f177.google.com with SMTP id z13so59252697iof.2 for <354@debbugs.gnu.org>; Sat, 01 Apr 2017 20:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=77S1rN5CkzGNtz04pdaQTBXw8fsVgfGvxJbfRhly7XU=; b=roikDBjbxpUl1eUisuF2Anj+6VRt5iC+9zk3KYKugzUqomIBI3mVvCSJtxnWwX8vEn zA1mU2exsJX1kEzOUDGMqq2PqF4RLevmf2GUV3SQMKIhrkcTfozGbu4rMku/Q5mmAg20 GIyo0Qy95pMPj1wF49AzteTMcTTikE3OzP8v+r6a5ZwlRk2Zg4okPRLg9482RVtOtZFY jsAmlOQ74aQlYpHzcrQBnZrkExySJQ3ohQbhQlbulW/72kyzg90G/BUF/FFLmY13L0YZ LeviycFSHJrXGErtiKnzSVQIAK3zdt61RO1VwxKwaLBe2ZyAGhfaAbONflEO8eSdiJ3u 5K8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=77S1rN5CkzGNtz04pdaQTBXw8fsVgfGvxJbfRhly7XU=; b=FWnamnPqjNnwq1JA4hs2qU05H9VoJTi79WcEC7bLbwFbMW0hc64GDd1qmSprzMPJEQ /ujMXQvkFJH2AAdgUrECgLxorpgdAy77lmZ4pgwNcLknxa8G8dadLRZVGo+qmE+7BhF9 uLPRcsaTuql56o3fTeSEZiewPMo7tTdX+HGjc355qXVha4UDZ1SdJ1lAGDtio/XNGltd yEOl4WjsPHoO0MJ/NuglB5NWA2fCOlETXS4SNAcvfcJMHnIdvtpuDEMdaLQG70JENODs eZvcSXvib5wMiYLVBPQLyNH5QBJHy264jpUN9+THpc1UXZMj9EUNRBxXYGaDtp45CofJ hQWQ== X-Gm-Message-State: AFeK/H3OjkxdDEbNramkjywtsXDmdHIAPpifulR4lwcoxyJRRxTN4VOIOqUbjMsDCGAe5g== X-Received: by 10.107.8.39 with SMTP id 39mr10468958ioi.189.1491105271050; Sat, 01 Apr 2017 20:54:31 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id k63sm5720465ioi.19.2017.04.01.20.54.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Apr 2017 20:54:29 -0700 (PDT) From: npostavs@users.sourceforge.net To: Eli Zaretskii Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> Date: Sat, 01 Apr 2017 23:55:53 -0400 In-Reply-To: <83zig04q2n.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 01 Apr 2017 09:09:04 +0300") Message-ID: <87shlrxy2e.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Yes, but only because of the non-interactive case. If that is not an > issue, you could simply pass the SDATA of the original string, because > we simply insert that into an echo-area buffer. The `' thing applies in the interactive case right? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-src-xdisp.c-vmessage-message-Clarify-commentary.patch Content-Description: patch >From 156859858e03baeddeb554c8df220171adaf6bf1 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 1 Apr 2017 17:54:26 -0400 Subject: [PATCH] * src/xdisp.c (vmessage, message): Clarify commentary. --- src/xdisp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 9ecfb86401..8ff291affb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10470,9 +10470,12 @@ message_with_string (const char *m, Lisp_Object string, bool log) /* Dump an informative message to the minibuf. If M is 0, clear out any existing message, and let the mini-buffer text show through. - The message must be safe ASCII and the format must not contain ` or - '. If your message and format do not fit into this category, - convert your arguments to Lisp objects and use Fmessage instead. */ + The message must be safe ASCII (because when Emacs is + non-interactive the message is sent straight to stderr without + encoding first) and the format must not contain ` or ' (because + this function does not account for `text-quoting-style'. If your + message and format do not fit into this category, convert your + arguments to Lisp objects and use Fmessage instead. */ static void ATTRIBUTE_FORMAT_PRINTF (1, 0) vmessage (const char *m, va_list ap) @@ -10530,6 +10533,7 @@ vmessage (const char *m, va_list ap) } } +/* See vmessage for restrictions on the text of the message. */ void message (const char *m, ...) { -- 2.11.1 --=-=-= Content-Type: text/plain >> >> if (!auto_saving && !noninteractive) >> Fmessage (build_string ("%s %d characters of %s"), >> build_string (NUMBERP (append) ? "Updated" >> : ! NILP (append) ? "Added" >> : "Wrote"), >> make_number (XINT (end) - XINT (start)), >> visit_file); > > Yes, this is also okay. Except I forgot the CALLN. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Output-number-of-characters-added-to-file-Bug-354.patch Content-Description: patch >From d077e66f21621aa0ac04fb148146836322f052d6 Mon Sep 17 00:00:00 2001 From: Jeff Clough Date: Fri, 27 Feb 2015 08:52:12 -0500 Subject: [PATCH v2] Output number of characters added to file (Bug#354) * fileio.c (write_region): * epa-file.el (epa-file-write-region): * jka-compr.el (jka-compr-write-region): * ange-ftp.el (ange-ftp-write-region): * tramp-gvfs.el (tramp-gvfs-handle-write-region): * tramp-sh.el (tramp-sh-handle-write-region): * mm-util.el (mm-append-to-file): Functions now output characters written in addition to file name. * files.texi: Added documentation to write-region and append-to-file describing their output. --- doc/emacs/files.texi | 8 +++++--- etc/NEWS | 5 +++++ lisp/epa-file.el | 2 +- lisp/gnus/mm-util.el | 2 +- lisp/jka-compr.el | 2 +- lisp/net/ange-ftp.el | 2 +- lisp/net/tramp-gvfs.el | 2 +- lisp/net/tramp-sh.el | 3 ++- src/fileio.c | 14 +++++++------- 9 files changed, 24 insertions(+), 16 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 0b730e27d3..ed17f66ca2 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1641,9 +1641,11 @@ Misc File Ops @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it 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}. The variable -@code{write-region-inhibit-fsync} applies to these commands, as well -as saving files; see @ref{Customize Save}. +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, as well as saving files; see @ref{Customize Save}. @findex set-file-modes @cindex file modes diff --git a/etc/NEWS b/etc/NEWS index f3ec3fe904..4e4da7d470 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -90,6 +90,11 @@ required capabilities are found in terminfo. See the FAQ node * Changes in Emacs 26.1 ++++ +** 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 variable 'emacs-version' no longer includes the build number. This is now stored separately in a new variable, 'emacs-build-number'. diff --git a/lisp/epa-file.el b/lisp/epa-file.el index c97acb837a..bc97992b5f 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -290,7 +290,7 @@ epa-file-write-region (if (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %s" buffer-file-name)))) + (message "Wrote %d characters to %s" (- end start) buffer-file-name)))) (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 89f397e3ed..5a58ed15b9 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -736,7 +736,7 @@ mm-append-to-file inhibit-file-name-handlers) inhibit-file-name-handlers))) (write-region start end filename t 'no-message) - (message "Appended to %s" filename))) + (message "Appended %d characters to %s" (- end start) filename))) (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 26a7cf506f..0be349f0fd 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -357,7 +357,7 @@ jka-compr-write-region (and (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %s" visit-file)) + (message "Wrote %d characters to %s" (- end start) visit-file)) ;; 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 cafdb3ecb0..54ffa3551f 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3284,7 +3284,7 @@ ange-ftp-write-region (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 %s" abbr) + (ange-ftp-message "Wrote %d characters to %s" (- end start) abbr) (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 59d8771cf1..eb0b832c0c 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1223,7 +1223,7 @@ tramp-gvfs-handle-write-region ;; The end. (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %s" filename)) + (tramp-message v 0 "Wrote %d characters to %s" (- end start) filename)) (run-hooks 'tramp-handle-write-region-hook))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index e4a48b7f8e..4db88ebd89 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3411,7 +3411,8 @@ tramp-sh-handle-write-region (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 %s" filename)) + (tramp-message v 0 "Wrote %d characters to %s" + (- end start) filename)) (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 acbf76e0d8..893d13192b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5150,13 +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); - + CALLN (Fmessage, + (build_string ("%s %d characters of `%s'"), + build_string (NUMBERP (append) ? "Updated" + : ! NILP (append) ? "Added" + : "Wrote"), + make_number (XINT (end) - XINT (start)), + visit_file)); return Qnil; } -- 2.11.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 02:16:07 2017 Received: (at 354) by debbugs.gnu.org; 2 Apr 2017 06:16:07 +0000 Received: from localhost ([127.0.0.1]:56362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuYo3-0001zy-Jm for submit@debbugs.gnu.org; Sun, 02 Apr 2017 02:16:07 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:42770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuYo1-0001xj-TH for 354@debbugs.gnu.org; Sun, 02 Apr 2017 02:16:06 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3vwlNh5JWcz1qqvh; Sun, 2 Apr 2017 08:16:04 +0200 (CEST) Received: from localhost (dynscan01.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3vwlNh1WjDz3jgXm; Sun, 2 Apr 2017 08:16:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan01.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id gTVOzuIy6eBZ; Sun, 2 Apr 2017 08:16:03 +0200 (CEST) X-Auth-Info: 70+KtWxnuzrrDoQt0kw02fhZrDR6q7JnjxmWiZ6p8QONfzX9a+BCt0yJJevR1egf Received: from igel.home (ppp-88-217-29-236.dynamic.mnet-online.de [88.217.29.236]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sun, 2 Apr 2017 08:16:03 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id C99B12C1B1C; Sun, 2 Apr 2017 08:16:02 +0200 (CEST) From: Andreas Schwab To: npostavs@users.sourceforge.net Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> <87shlrxy2e.fsf@users.sourceforge.net> X-Yow: Everybody gets free BORSCHT! Date: Sun, 02 Apr 2017 08:16:02 +0200 In-Reply-To: <87shlrxy2e.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sat, 01 Apr 2017 23:55:53 -0400") Message-ID: <871stb1gil.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, Eli Zaretskii , eggert@cs.ucla.edu, kb1vqh@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) On Apr 01 2017, npostavs@users.sourceforge.net wrote: > diff --git a/src/xdisp.c b/src/xdisp.c > index 9ecfb86401..8ff291affb 100644 > --- a/src/xdisp.c > +++ b/src/xdisp.c > @@ -10470,9 +10470,12 @@ message_with_string (const char *m, Lisp_Object string, bool log) > /* Dump an informative message to the minibuf. If M is 0, clear out > any existing message, and let the mini-buffer text show through. > > - The message must be safe ASCII and the format must not contain ` or > - '. If your message and format do not fit into this category, > - convert your arguments to Lisp objects and use Fmessage instead. */ > + The message must be safe ASCII (because when Emacs is > + non-interactive the message is sent straight to stderr without > + encoding first) and the format must not contain ` or ' (because > + this function does not account for `text-quoting-style'. If your > + message and format do not fit into this category, convert your > + arguments to Lisp objects and use Fmessage instead. */ Missing a close paren. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 11:52:44 2017 Received: (at 354) by debbugs.gnu.org; 2 Apr 2017 15:52:44 +0000 Received: from localhost ([127.0.0.1]:57657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuho4-0007K9-Cj for submit@debbugs.gnu.org; Sun, 02 Apr 2017 11:52:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuho3-0007Jo-BN for 354@debbugs.gnu.org; Sun, 02 Apr 2017 11:52:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuhnv-0008Pb-7M for 354@debbugs.gnu.org; Sun, 02 Apr 2017 11:52:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,PLING_QUERY, RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuhnl-0008H7-2i; Sun, 02 Apr 2017 11:52:25 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1516 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cuhnk-0001Gy-7X; Sun, 02 Apr 2017 11:52:24 -0400 Date: Sun, 02 Apr 2017 18:52:31 +0300 Message-Id: <834ly6rem8.fsf@gnu.org> From: Eli Zaretskii To: npostavs@users.sourceforge.net In-reply-to: <87shlrxy2e.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> <87shlrxy2e.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -4.7 (----) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.7 (----) > From: npostavs@users.sourceforge.net > Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu > Date: Sat, 01 Apr 2017 23:55:53 -0400 > > Eli Zaretskii writes: > > > Yes, but only because of the non-interactive case. If that is not an > > issue, you could simply pass the SDATA of the original string, because > > we simply insert that into an echo-area buffer. > > The `' thing applies in the interactive case right? Yes. > diff --git a/lisp/epa-file.el b/lisp/epa-file.el > index c97acb837a..bc97992b5f 100644 > --- a/lisp/epa-file.el > +++ b/lisp/epa-file.el > @@ -290,7 +290,7 @@ epa-file-write-region > (if (or (eq visit t) > (eq visit nil) > (stringp visit)) > - (message "Wrote %s" buffer-file-name)))) > + (message "Wrote %d characters to %s" (- end start) buffer-file-name)))) Shouldn't this and others use `' as well? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 12:09:22 2017 Received: (at 354) by debbugs.gnu.org; 2 Apr 2017 16:09:22 +0000 Received: from localhost ([127.0.0.1]:57671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cui4A-0007l3-Dg for submit@debbugs.gnu.org; Sun, 02 Apr 2017 12:09:22 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:36018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cui48-0007ko-Ep for 354@debbugs.gnu.org; Sun, 02 Apr 2017 12:09:20 -0400 Received: by mail-it0-f46.google.com with SMTP id e75so35398545itd.1 for <354@debbugs.gnu.org>; Sun, 02 Apr 2017 09:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=mI5q6fGFkwzfnyWFCUjavxfYlfqZwr9LudfjBy0pT5U=; b=a6JmDpaE/Xd/UYrwiMH3l+tVs4Xc6mY0B4tv4bvi95fX7nk2OAMRYfE5MvSv8lQmpj 0gFYOzwFGapAQb/HCB6Lg35ar9eY9A0H3xZ6o2L/ko+HkDAct5JdhDlk01ZcvFrR9fIh oAnqUaLb9k1EB77Y+voDHKORmuPGL+Bc0KhH7I785hgnTPQMytICcrgTLAOj1DexGTOh 0Fa9nwwzElJl/Q/enQBSKV68GOzNeBw6Kz6hQkz+iBsaicCl3VXXQeddI4JGf3vtMJrN Zga10f5Kp51PjJdFqfpaLvE1s9HnsB8fSL/cwDLLcj6Y2MHfHyaDJCPO3b1UhoU1BB7p qNxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=mI5q6fGFkwzfnyWFCUjavxfYlfqZwr9LudfjBy0pT5U=; b=b9+HuSVOsbZ3lyFdIy9izdKIoutg5Ml5Iva0NZfqYL8ix3YXKJ9nGd3LMu4OLifWo2 34BKN6U4P30kw5kU0B/YBWyDT3AjXPotUaeu14LnPlkk9e7+zaKMDHIQA8wGISrKY4hf luvgGaRKkotoyoGuz/z7YhZiB1ne10gosy1R/4ZhmElQg/ETbGU28MzwlwlYFvngmwh8 I1WCUN5PaoH/ayvtpCmnkSZtaDr6MuhGvjRfR4OLM5gnDO2cx35bMi1H09OAZplbRn3S hc0UUZHdH89blEVfAurcf4KGb10xpk2l9YslPlFDAeHWkQsTwP3fsfd7NMqmZemrJlS8 JEew== X-Gm-Message-State: AFeK/H2GOVhXqC4gSY3HDYJGbADJj7I3fq3HyYItOMOB+ZQrQ3XK48rbopgJ8pIZg/7pDQ== X-Received: by 10.36.4.88 with SMTP id 85mr6429049itb.92.1491149354915; Sun, 02 Apr 2017 09:09:14 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id f63sm4498142ita.26.2017.04.02.09.09.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Apr 2017 09:09:14 -0700 (PDT) From: npostavs@users.sourceforge.net To: Andreas Schwab Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> <87shlrxy2e.fsf@users.sourceforge.net> <871stb1gil.fsf@linux-m68k.org> Date: Sun, 02 Apr 2017 12:10:36 -0400 In-Reply-To: <871stb1gil.fsf@linux-m68k.org> (Andreas Schwab's message of "Sun, 02 Apr 2017 08:16:02 +0200") Message-ID: <87zifyx01v.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, Eli Zaretskii , eggert@cs.ucla.edu, kb1vqh@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain Andreas Schwab writes: > > Missing a close paren. Oops. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v3-0001-src-xdisp.c-vmessage-message-Clarify-commentary.patch Content-Description: patch >From d085d1fd7283fe29f656c49f619e33eb2f47829d Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 1 Apr 2017 17:54:26 -0400 Subject: [PATCH v3] * src/xdisp.c (vmessage, message): Clarify commentary. --- src/xdisp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 9ecfb86401..c6f8566523 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10470,9 +10470,12 @@ message_with_string (const char *m, Lisp_Object string, bool log) /* Dump an informative message to the minibuf. If M is 0, clear out any existing message, and let the mini-buffer text show through. - The message must be safe ASCII and the format must not contain ` or - '. If your message and format do not fit into this category, - convert your arguments to Lisp objects and use Fmessage instead. */ + The message must be safe ASCII (because when Emacs is + non-interactive the message is sent straight to stderr without + encoding first) and the format must not contain ` or ' (because + this function does not account for `text-quoting-style'). If your + message and format do not fit into this category, convert your + arguments to Lisp objects and use Fmessage instead. */ static void ATTRIBUTE_FORMAT_PRINTF (1, 0) vmessage (const char *m, va_list ap) @@ -10530,6 +10533,7 @@ vmessage (const char *m, va_list ap) } } +/* See vmessage for restrictions on the text of the message. */ void message (const char *m, ...) { -- 2.11.1 --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> - (message "Wrote %s" buffer-file-name)))) >> + (message "Wrote %d characters to %s" (- end start) buffer-file-name)))) > > Shouldn't this and others use `' as well? Yeah, I think so. I forgot to look at the others before. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v3-0001-Output-number-of-characters-added-to-file-Bug-354.patch Content-Description: patch >From 4f08c9eb93dec1aa923a647214d4a613f3408964 Mon Sep 17 00:00:00 2001 From: Jeff Clough Date: Fri, 27 Feb 2015 08:52:12 -0500 Subject: [PATCH v3] Output number of characters added to file (Bug#354) * fileio.c (write_region): * epa-file.el (epa-file-write-region): * jka-compr.el (jka-compr-write-region): * ange-ftp.el (ange-ftp-write-region): * tramp-gvfs.el (tramp-gvfs-handle-write-region): * tramp-sh.el (tramp-sh-handle-write-region): * mm-util.el (mm-append-to-file): Functions now output characters written in addition to file name. * files.texi: Added documentation to write-region and append-to-file describing their output. --- doc/emacs/files.texi | 8 +++++--- etc/NEWS | 5 +++++ lisp/epa-file.el | 2 +- lisp/gnus/mm-util.el | 2 +- lisp/jka-compr.el | 2 +- lisp/net/ange-ftp.el | 2 +- lisp/net/tramp-gvfs.el | 2 +- lisp/net/tramp-sh.el | 3 ++- src/fileio.c | 14 +++++++------- 9 files changed, 24 insertions(+), 16 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 0b730e27d3..ed17f66ca2 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1641,9 +1641,11 @@ Misc File Ops @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it 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}. The variable -@code{write-region-inhibit-fsync} applies to these commands, as well -as saving files; see @ref{Customize Save}. +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, as well as saving files; see @ref{Customize Save}. @findex set-file-modes @cindex file modes diff --git a/etc/NEWS b/etc/NEWS index f3ec3fe904..4e4da7d470 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -90,6 +90,11 @@ required capabilities are found in terminfo. See the FAQ node * Changes in Emacs 26.1 ++++ +** 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 variable 'emacs-version' no longer includes the build number. This is now stored separately in a new variable, 'emacs-build-number'. diff --git a/lisp/epa-file.el b/lisp/epa-file.el index c97acb837a..72ffb58c30 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -290,7 +290,7 @@ epa-file-write-region (if (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %s" buffer-file-name)))) + (message "Wrote %d characters to `%s'" (- end start) buffer-file-name)))) (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 89f397e3ed..f0dc803edd 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -736,7 +736,7 @@ mm-append-to-file inhibit-file-name-handlers) inhibit-file-name-handlers))) (write-region start end filename t 'no-message) - (message "Appended to %s" filename))) + (message "Appended %d characters to `%s'" (- end start) filename))) (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 26a7cf506f..55440a709c 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -357,7 +357,7 @@ jka-compr-write-region (and (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %s" visit-file)) + (message "Wrote %d characters to `%s'" (- end start) visit-file)) ;; 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 cafdb3ecb0..aecb9e1ecb 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3284,7 +3284,7 @@ ange-ftp-write-region (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 %s" abbr) + (ange-ftp-message "Wrote %d characters to `%s'" (- end start) abbr) (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 59d8771cf1..8ab34af85b 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1223,7 +1223,7 @@ tramp-gvfs-handle-write-region ;; The end. (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %s" filename)) + (tramp-message v 0 "Wrote %d characters to `%s'" (- end start) filename)) (run-hooks 'tramp-handle-write-region-hook))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index e4a48b7f8e..68bed278ed 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3411,7 +3411,8 @@ tramp-sh-handle-write-region (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 %s" filename)) + (tramp-message v 0 "Wrote %d characters to `%s'" + (- end start) filename)) (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 acbf76e0d8..893d13192b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5150,13 +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); - + CALLN (Fmessage, + (build_string ("%s %d characters of `%s'"), + build_string (NUMBERP (append) ? "Updated" + : ! NILP (append) ? "Added" + : "Wrote"), + make_number (XINT (end) - XINT (start)), + visit_file)); return Qnil; } -- 2.11.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 14:24:39 2017 Received: (at 354) by debbugs.gnu.org; 2 Apr 2017 18:24:39 +0000 Received: from localhost ([127.0.0.1]:57729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cukB5-0002YG-3S for submit@debbugs.gnu.org; Sun, 02 Apr 2017 14:24:39 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cukB3-0002Xw-3L for 354@debbugs.gnu.org; Sun, 02 Apr 2017 14:24:37 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2A9331600EA; Sun, 2 Apr 2017 11:24:31 -0700 (PDT) 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 dFyKduycYYX2; Sun, 2 Apr 2017 11:24:30 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 892B11600DD; Sun, 2 Apr 2017 11:24:30 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu 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 L-NfTMj4Ww30; Sun, 2 Apr 2017 11:24:30 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 6B78C1600B3; Sun, 2 Apr 2017 11:24:30 -0700 (PDT) Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" To: npostavs@users.sourceforge.net, Eli Zaretskii References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> <87shlrxy2e.fsf@users.sourceforge.net> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sun, 2 Apr 2017 11:24:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <87shlrxy2e.fsf@users.sourceforge.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) On 04/01/2017 08:55 PM, npostavs@users.sourceforge.net wrote: > + (build_string ("%s %d characters of `%s'"), > + build_string (NUMBERP (append) ? "Updated" > + : ! NILP (append) ? "Added" > + : "Wrote"), This should use AUTO_STRING instead of build_string. Also, follow the old code and use just one string (a format) instead of two, as it's more important to use idiomatic English than to save a few bytes in the Emacs executable. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 14:38:51 2017 Received: (at 354) by debbugs.gnu.org; 2 Apr 2017 18:38:51 +0000 Received: from localhost ([127.0.0.1]:57738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cukOp-0002sz-IW for submit@debbugs.gnu.org; Sun, 02 Apr 2017 14:38:51 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:38870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cukOn-0002sk-Nl for 354@debbugs.gnu.org; Sun, 02 Apr 2017 14:38:50 -0400 Received: by mail-it0-f45.google.com with SMTP id y18so32728049itc.1 for <354@debbugs.gnu.org>; Sun, 02 Apr 2017 11:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=NPm1SME72Y5rj/FQlYDsA6ZWqUpszx2FYihFXwwJvM4=; b=Zr/MEdo7wWUQC8JOr1M/FfsKXHuleE/a7/aMP53g2JgvGoPCJNIEswZgJuIyT0oZtN anNNGJ7vghGUGlVWEUIKW0KOEGr/7zw7vF+4S7D4II+gdGbqmOFU9qc8iaYm3DKy1cVR MXPvrKCb9OtlDrnOXdUM8l6hDXrgLFMJgAw1ly0DF9jcHN0l2046kEFff8FaYqOacs0E Cegwg6C2PNzraZMYb1p/7W1O5xUQ9P2AOgjN6L/SCGAJv8JSsNhyHR3RV/64WPIN+91T 0lUbS30QIqhCHR5t+4p885rQneKZJqROP0bHLb+9uotgUiYI45uTSiqz+vs+jT1q+/qg 5Vfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=NPm1SME72Y5rj/FQlYDsA6ZWqUpszx2FYihFXwwJvM4=; b=seFwJsSYnIUjyZM7Tqmjmk6JuYvzEiHrsQs6Opy3+XJcDgwp38YjiDMIPw3BVpaMV5 /s+DzFnz4NYQjIQ0nWEuHurSG2O6xtKSeRoOD2WivN78j/DhTp3LFALsOadwe2Gmxq/S FZUW3nV9ag1dFfGnH8w+W3ky+AcFpZb3jFGTw3guUd8vtEHsWS9j9xrsKbQXAwlG1AId iuX6dQLpgC0kqDTh/g8ONz7lnj+uMcUH18h8LoRr49R/WYaF1GUzJ4fegehKc+04tJ9L AGwIH2uk7Etpv5xhCl6dV4svB5eIeTOIrc7PDidKecD8b5UoC2WiHSKXPzDgBdSq+RCG l1bg== X-Gm-Message-State: AFeK/H3p/ygN0UEHG8webxYl0Gzf0+iSM1UCRTVsw8S1wj6cTVFiF1Ob aYTKZ9coIklmEQ== X-Received: by 10.36.241.15 with SMTP id c15mr6639005iti.77.1491158324117; Sun, 02 Apr 2017 11:38:44 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id q185sm4668123itc.22.2017.04.02.11.38.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Apr 2017 11:38:43 -0700 (PDT) From: npostavs@users.sourceforge.net To: Paul Eggert Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> <87shlrxy2e.fsf@users.sourceforge.net> Date: Sun, 02 Apr 2017 14:40:06 -0400 In-Reply-To: (Paul Eggert's message of "Sun, 2 Apr 2017 11:24:30 -0700") Message-ID: <87shlqwt4p.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, Eli Zaretskii , kb1vqh@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Paul Eggert writes: > On 04/01/2017 08:55 PM, npostavs@users.sourceforge.net wrote: >> + (build_string ("%s %d characters of `%s'"), >> + build_string (NUMBERP (append) ? "Updated" >> + : ! NILP (append) ? "Added" >> + : "Wrote"), > > This should use AUTO_STRING instead of build_string. Okay. (there seems to be a lot of different ways to create a lisp string object) > Also, follow the > old code and use just one string (a format) instead of two, as it's > more important to use idiomatic English than to save a few bytes in > the Emacs executable. I find the code more readable when there is only one format string, instead of a conditional choosing amongst three. I'm not sure what you mean about "idiomatic English" as both versions produce the same text. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 14:44:42 2017 Received: (at 354) by debbugs.gnu.org; 2 Apr 2017 18:44:42 +0000 Received: from localhost ([127.0.0.1]:57742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cukUU-00031G-7i for submit@debbugs.gnu.org; Sun, 02 Apr 2017 14:44:42 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:54864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cukUT-000315-Bb for 354@debbugs.gnu.org; Sun, 02 Apr 2017 14:44:41 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A8D681600B3; Sun, 2 Apr 2017 11:44:35 -0700 (PDT) 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 yS_2NhZ3uMmw; Sun, 2 Apr 2017 11:44:35 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0A8041600DD; Sun, 2 Apr 2017 11:44:35 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu 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 aiq4UPgz-xY1; Sun, 2 Apr 2017 11:44:34 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id E434C1600B3; Sun, 2 Apr 2017 11:44:34 -0700 (PDT) Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" To: npostavs@users.sourceforge.net References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> <87shlrxy2e.fsf@users.sourceforge.net> <87shlqwt4p.fsf@users.sourceforge.net> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <4ac2a524-05db-071b-6628-73a5ccad14ce@cs.ucla.edu> Date: Sun, 2 Apr 2017 11:44:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <87shlqwt4p.fsf@users.sourceforge.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, Eli Zaretskii , kb1vqh@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) On 04/02/2017 11:40 AM, npostavs@users.sourceforge.net wrote: > I'm not sure what you > mean about "idiomatic English" as both versions produce the same text. The old version says "Added to FOO" whereas the new says "Added N characters of `FOO'". The "to" is more idiomatic than the "of". Part of the idea is to make Emacs more translatable in the future, if we should ever get around to doing that. It's typically easier to translate three English-language format strings that talk about three different things, than to try to translate three-way Lisp code that assumes English grammar when constructing a single format string. Admittedly Emacs often uses tricky code like this elsewhere; still, it's better to avoid adding more such tricks. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 15:07:53 2017 Received: (at 354) by debbugs.gnu.org; 2 Apr 2017 19:07:53 +0000 Received: from localhost ([127.0.0.1]:57751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cukqv-0003aD-FP for submit@debbugs.gnu.org; Sun, 02 Apr 2017 15:07:53 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:36263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cukqt-0003Zv-Ka for 354@debbugs.gnu.org; Sun, 02 Apr 2017 15:07:51 -0400 Received: by mail-io0-f194.google.com with SMTP id 68so10300951ioh.3 for <354@debbugs.gnu.org>; Sun, 02 Apr 2017 12:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2RMaw7rZMOIwMuv/xz73kAn/e5+l8LhLQY27dvT8rUs=; b=FiMBu5c4SDO7Mj7aLAfQDV24VJaR14P9Fsn3YluucWvK/Kb1VVDE/bIRkt19ueTzme roWglG+s8DZ4Nf2dljeOpW+Nz56AcKVxeB+m5gajtcuVpc+HTlFMm9yb+vn8/tVR22K4 FOQjkAxGJNDzZyx7da8MiTweFC+iKgDH9ZYeKJvhXoIdRQuf5hdYGjoTEscBCEnAM4gZ 3kRj+EMhtuyzcZrfl6knnNee6zwYQkngiExXBwMc/le2LPUtT9Nasua79VlNSGFq+ekN NX6V7X/T0DE025IOeSukirwLoh3+MwLgMZ6YjpyqQq+rHzHPGGJ0E6DxYQyeQOs3lHA/ Yo4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=2RMaw7rZMOIwMuv/xz73kAn/e5+l8LhLQY27dvT8rUs=; b=mIlSZ3BLbxInW6E63JfZUlSRFlkHv2+QoEgmJpwLhIkqZCATKsaXaVk5jUZaGdKQRx +YAzOPkL7GToYIT+IME/aSqxTk3Yl/z/24PJX6jUJBaIhjEE+MTnQB5TsIFg734tV+DV 4VMABu9rND+xNvqqpQBSwKheGT++JDZ/JcuJrkvtnyPPNOJAecMglAtQIx6juToLTEwo 97j4JOAVraYYUAYPZv+danhJyzAjnVDccIuJigWCiPSRZy8xJTEJ/2KlZEw12n/EVpvq P8fx4p4oLz8vyEXrxVy8kDFLLccfZbEHPZ6Pjw9cb7SAaydfaXWGEjga8a3C4CQJv7ix bujg== X-Gm-Message-State: AFeK/H1Cn/bebX5CBQQtKDc6jvRQssJGB0L2a+YyB0UFSGFKJprlSNWj2TMhaQMYEHcyhA== X-Received: by 10.107.185.135 with SMTP id j129mr12446056iof.3.1491160066141; Sun, 02 Apr 2017 12:07:46 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id b132sm6595455iob.6.2017.04.02.12.07.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Apr 2017 12:07:45 -0700 (PDT) From: npostavs@users.sourceforge.net To: Paul Eggert Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> <87shlrxy2e.fsf@users.sourceforge.net> <87shlqwt4p.fsf@users.sourceforge.net> <4ac2a524-05db-071b-6628-73a5ccad14ce@cs.ucla.edu> Date: Sun, 02 Apr 2017 15:09:07 -0400 In-Reply-To: <4ac2a524-05db-071b-6628-73a5ccad14ce@cs.ucla.edu> (Paul Eggert's message of "Sun, 2 Apr 2017 11:44:34 -0700") Message-ID: <87poguwrsc.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, Eli Zaretskii , kb1vqh@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) Paul Eggert writes: > On 04/02/2017 11:40 AM, npostavs@users.sourceforge.net wrote: >> I'm not sure what you >> mean about "idiomatic English" as both versions produce the same text. > > The old version says "Added to FOO" whereas the new says "Added N > characters of `FOO'". The "to" is more idiomatic than the "of". Oh, huh. Apparently I didn't actually read the original code. I must *really* not like the multi-format string style. But yes, producing a correct message is more important. Here's the fixed code: if (!auto_saving && !noninteractive) { AUTO_STRING (format, NUMBERP (append) ? "Updated %d characters of `%s'" : ! NILP (append) ? "Added %d characters to `%s'" : "Wrote %d characters to `%s'"); CALLN (Fmessage, format, make_number (XINT (end) - XINT (start)), visit_file); } From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 06 22:26:33 2017 Received: (at 354) by debbugs.gnu.org; 7 Apr 2017 02:26:33 +0000 Received: from localhost ([127.0.0.1]:35595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwJbc-0004Wo-L3 for submit@debbugs.gnu.org; Thu, 06 Apr 2017 22:26:32 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:35580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwJbZ-0004WT-4Q; Thu, 06 Apr 2017 22:26:30 -0400 Received: by mail-io0-f196.google.com with SMTP id f103so6273623ioi.2; Thu, 06 Apr 2017 19:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XRtar+co4ESycCeoizeGDnbSNt2WRkjfsyI7lC0MD1I=; b=i0QGdFKwwjII6RMqMw0pYUrlqgPNI+rZOhG+SSPl6R/huqAWQdcHclNKCvrbQlyI5j eeHsIsJNExfIv4kDNl05PZ1nW5gBAhsU3I72CsBvcPE5ifcuBc20QtPSVioWfn1WVpnv T6z9kLKq5P79dXiS3KPGyTM96jlcuf1/X9sUsUNvttFRjAYtMhuNPCXvOnhb+Wk8g0M7 b9xNdQ5EREnjlz0i3Ho73AfjJc1G6GSzc64Kpb3YMLMr+7MNxpJduGAGC0zUnHtODv2Y llpszZLOzU/H0K4CYMMviK5cNc/04nUFxdwULkLKG0uUyX3FXmEUoDVwfEz7iHEL/3JX UPzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=XRtar+co4ESycCeoizeGDnbSNt2WRkjfsyI7lC0MD1I=; b=dEgtZKwwRktvBtuOSDGAxkT/V2Gu1WiDfuLNuj8uLEU2cPXgl/L8CQW8HwJohUwZUm kLgGrLF6wOoFsaU1N6PsYd6f2P4CUOYZRvtpGMm5sRsXA0XkooTZz5ePBRS75Ua5fNa7 0bpYbSDBKQY5iSBmMukujq2VvHEFHceoa7evLkyAzmzwIQuD7rZ/Tx8MAOEKPtFTPabi Tee+oQFRXwJSB0S9BQvYNoQGHBA8tts2QwdxKuVX28l0lYYDbtA3ZUFo55nO53OlMNG2 3cRO8BxMzCca2ScHVVR8Rdg4BJa9TKmtOrtsNGvJZAunp2mlaIa3wPpp6I7w7706PGW4 q/eQ== X-Gm-Message-State: AFeK/H3Oz2PfYmBbEqu2eb/H1u2u7dNId3IX5PLz5bmdC/GkaEZWPx8G/UcTN8P5v1NEhw== X-Received: by 10.107.183.66 with SMTP id h63mr36794042iof.60.1491531983595; Thu, 06 Apr 2017 19:26:23 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id p6sm1858290iof.12.2017.04.06.19.26.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Apr 2017 19:26:22 -0700 (PDT) From: npostavs@users.sourceforge.net To: Paul Eggert Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <54F01AE2.8050406@cs.ucla.edu> <87y4njzckz.fsf@gmail.com> <87fuig7jxo.fsf@users.sourceforge.net> <83h92vc0op.fsf@gnu.org> <87mvc021mr.fsf@users.sourceforge.net> <83zig04q2n.fsf@gnu.org> <87shlrxy2e.fsf@users.sourceforge.net> <87shlqwt4p.fsf@users.sourceforge.net> <4ac2a524-05db-071b-6628-73a5ccad14ce@cs.ucla.edu> <87poguwrsc.fsf@users.sourceforge.net> Date: Thu, 06 Apr 2017 22:27:46 -0400 In-Reply-To: <87poguwrsc.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sun, 02 Apr 2017 15:09:07 -0400") Message-ID: <8760ihuf31.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org, Eli Zaretskii , kb1vqh@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) tags 354 fixed close 354 26.1 quit npostavs@users.sourceforge.net writes: > Here's the fixed code: Pushed to master [1: cd0a7951fb]. 1: 2017-04-06 22:23:27 -0400 cd0a7951fb762570c4b9c2cdbb43c94cb68910d4 Output number of characters added to file (Bug#354) From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 09 22:16:37 2017 Received: (at 354) by debbugs.gnu.org; 10 Apr 2017 02:16:37 +0000 Received: from localhost ([127.0.0.1]:40355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxOsf-0006o7-3b for submit@debbugs.gnu.org; Sun, 09 Apr 2017 22:16:37 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:35046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxOsd-0006nj-Lh for 354@debbugs.gnu.org; Sun, 09 Apr 2017 22:16:36 -0400 Received: by mail-io0-f172.google.com with SMTP id r16so25575183ioi.2 for <354@debbugs.gnu.org>; Sun, 09 Apr 2017 19:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=6fwSyTj9LDuzrVWDdvO8j1oSya01uPRJxQKEqXQUqh8=; b=Y0iZNOSa3fDsEwnyj2kX/oB5kaRS6d7ysCfecP8mtGihK7QuwUmn3ybX9M0Bw/y8tT O+yO/UzAmiaugXNx9sznM++41buDFzJXmgWiNrPDFQRXE4ZN6BbPbjvJTvrocY5jDA2d tdS7eqtLODk4/apYNRyWndEEJm1gSv+OgLu30yTG9m7oy7R19qSGr8yZLbWHyLN1wgUE g0Vp9LlKZmJ+ocTD3VdxsRD4dLe8elgg0pD3cMu3HtcOITlunsw18o61MbHbWF0JpFG+ Ob+QH8C8hnI/4MD7luaqqwYxxG8AM65pzagn+GW8XkQNsBgtmo1qVA1qhWzxvA4Q0yMc 6exQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=6fwSyTj9LDuzrVWDdvO8j1oSya01uPRJxQKEqXQUqh8=; b=JWKmjMNFQ/yk0grENqm2x4qhqx2hjLHxRJkXEBCYtKJ5fnlOUcDvNMYwBlh3c6sk8I 3kE+b7tCgM91bRl2jiH7kwk3hL/OS3s6jNOuOtXJ0SAi2tQT4ptcEyeEXEZeL8xWgFof 8MsULBb275R5ALYUwRDs45RpWPyMWHqDb65MjETGfJYgsI/i4jbVsjIy22VJ+EfjPZwc s+VtUNMvjcFsiBvmGXz8xVl/WO9330zLvO3qVVN23IK9EjUoZzl0p/kkhWqxIiiY7lgL Ah/LAfXDSOnlziextANJwgvhWcm/DEa2B40U/zc3r4g70q0tzdBC1mJ9iCSpLZMSZlAw /U6Q== X-Gm-Message-State: AFeK/H3XVPyn/2z8wCi9viNWk/wpJJ5yIQvBwXjIYff7out95Fwuoh3tEN/LGcOy7cgCUg== X-Received: by 10.107.31.11 with SMTP id f11mr56605537iof.183.1491790589961; Sun, 09 Apr 2017 19:16:29 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id p70sm4256323itg.0.2017.04.09.19.16.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Apr 2017 19:16:29 -0700 (PDT) From: npostavs@users.sourceforge.net To: jidanni@jidanni.org Subject: Re: bug#354: "Added (how many lines, bytes?!) to file.txt" References: <87r6bemkjj.fsf@jidanni.org> Date: Sun, 09 Apr 2017 22:17:54 -0400 In-Reply-To: <87r6bemkjj.fsf@jidanni.org> (jidanni@jidanni.org's message of "Wed, 04 Jun 2008 02:37:52 +0800") Message-ID: <87lgr9t38t.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 354 Cc: 354@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) jidanni@jidanni.org writes: > Gentlemen, (I sound like Prince's "Partyman" song) > I noticed all append-to-file says is > "Added to /var/neurdsbeurg.txt". > > The problem is often the user thinks "good, thanks", when days later > he discovers few or no lines got added, that's right, even 0 bytes > will produce the same message. You see often we are not fully aware of > the extent of our regions, colored or not, especially when extending > off the screen. > > Therefore I propose you change that message to say instead how many > line or bytes or characters or both or all three were copied over. > > All this of course also applies to write-region. While the proposed solution of adding information to the message seemed good in theory, in practice it has turned out to be kind of annoying. I'm not sure if this is worth adding yet another option that hardly anyone will use. Is the problem mainly about writing 0 bytes to a file, perhaps we can just add a warning for that particular case? At this point I'm considering just reverting the recent changes for this, and marking the bug wontfix. From unknown Tue Jun 17 01:47:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 08 May 2017 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Tue May 09 00:37:42 2017 Received: (at control) by debbugs.gnu.org; 9 May 2017 04:37:42 +0000 Received: from localhost ([127.0.0.1]:60494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7wu6-0002CE-Gs for submit@debbugs.gnu.org; Tue, 09 May 2017 00:37:42 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:35526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7wu5-0002By-3T; Tue, 09 May 2017 00:37:41 -0400 Received: by mail-io0-f175.google.com with SMTP id f102so62611692ioi.2; Mon, 08 May 2017 21:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=aHwYJXGrka/eRBUcHs+Fz7tBXvSXLYBYYaIUKb2FpmE=; b=YsvpmO/dCnZTIwd5qzHEUnEYbOCmQbLnjLUYIuczE1cUedriMybtJN9LylYraZlo4j 1xeCx42gXF5q817OaJSAtSQC6dslhUPBp0E/2YyLTf8RLW9Vs+klhUUWRyVa4hjefCyD FZqPteeFd0yOTQ2uFM4fPQmGEyDD+NDtm4MJqR/pDxvj/UsJYQTChGRb3N8ev3D7hqYi UPHO10Om5SDKZ7ehw9NuEt9T1lxRKc0JNbqCUWOT6deDBVOEB+x7tmvTQIzzS2lYlN3d eBVcORbt2cg1eDCVgjDxQNixMayz7518cJ4H9EWcobuVDDsFmeyVoleQZzhZHu7HRlYI 6v7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=aHwYJXGrka/eRBUcHs+Fz7tBXvSXLYBYYaIUKb2FpmE=; b=tUBl3AhToNkOzeZeTtBmYs5cpZvaTPm8XbMqAhyD9Yj6aqsFtbctpcaDqBJuVXSQ2P ENTr/qabrvKxjLQhgplUAb0Loy0z8DhN1fBU/9FH2IEVPoXPoUXB6b5lTI4v1oqlXeGy TFuBXJfzejkLWKTDxurxzb/60oR6NkEYuLkB/1urQMxdiddIMLnJSDHo7wzRPzqizU79 +eAtv8euqk2JMWW47RALw+ebGt7awVMkoEgj6O+8rlTrcF97M1exxZMtKC6MYF32VyUZ DiI/vGMSW9GFZWd9j/idjcWuxWxzdX46cpz+oZ7CNvHl8llqhYWHJWhjZ5c+rg/2w83d Dh/A== X-Gm-Message-State: AN3rC/66kwflMuAv/DZLqToibswCoOivvuhl7/EuyOkj+DOF0+qAgZBU SW5EcQGKu89cEQ== X-Received: by 10.107.133.8 with SMTP id h8mr29934961iod.19.1494304655496; Mon, 08 May 2017 21:37:35 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id m4sm5532114ith.5.2017.05.08.21.37.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 May 2017 21:37:34 -0700 (PDT) From: npostavs@users.sourceforge.net To: Glenn Morris Subject: Re: bug#26796: 26.0.50; (2 characters) is usually wrong References: <87wp9ukwne.fsf@users.sourceforge.net> <831ss2f4pz.fsf@gnu.org> <87efw00wm4.fsf@holos> <83tw4vct9k.fsf@gnu.org> Date: Tue, 09 May 2017 00:39:06 -0400 In-Reply-To: (Glenn Morris's message of "Mon, 08 May 2017 11:59:52 -0400") Message-ID: <87ziemk5jp.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: control Cc: Mark Oteiza , larsi@gnus.org, Eli Zaretskii , 26796@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) unarchive 354 tags 354 = wontfix quit Glenn Morris writes: > Eli Zaretskii wrote: > >>> Was there any reason to implement it in the first place? >> >> Seems we are back at the discussion we had starting here: >> >> http://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00219.html > > In which, if I read right, literally no-one was in favour of the feature? > A feature that several people have now spent time debugging, tweaking, > and documenting, and which will have to be supported going forwards. My only defence is that everyone seemed to think it was a good idea *before* I merged it. In hindsight I should have reverted this much sooner, but anyway, it's done now [1: daaec72a82]. [1: daaec72a82]: 2017-05-08 23:28:32 -0400 Revert "Output number of characters added to file (Bug#354)" http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=daaec72a82e76f916e639acb51a8ad602433e8a9 From debbugs-submit-bounces@debbugs.gnu.org Tue May 09 00:40:46 2017 Received: (at control) by debbugs.gnu.org; 9 May 2017 04:40:46 +0000 Received: from localhost ([127.0.0.1]:60502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7wx3-0002H4-6A for submit@debbugs.gnu.org; Tue, 09 May 2017 00:40:46 -0400 Received: from mail-it0-f41.google.com ([209.85.214.41]:38147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7wx1-0002Gq-9E for control@debbugs.gnu.org; Tue, 09 May 2017 00:40:43 -0400 Received: by mail-it0-f41.google.com with SMTP id e65so50229287ita.1 for ; Mon, 08 May 2017 21:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=+dAS2CtZ/5djlineYSND7TA0EqXJw2j7dADqHQYRWh0=; b=NnvBp8icVzOpq2O9m55RL8K+6zAAbtATbnh2yDzMUA8PCdswXklVxp0QC+iH8Ji5St 7T+YALGB/xcnvAcU65+7ysqF1CNEGqhrdLLhhr3/oT2KaJIM4z+hBwRHt+92tRHBJUZI wPsXgDhjpbnYJiPIWfIz7Ll00qGg8NMTzIGN0czAkd9T5vu8mTXyeOnKx3phceL2envq CrprYvna7KLZkWM8SLxiL/yaGSgvfHaHwwGE4SXlzAA+QZGlGndbsDBxfcF1MvmmK2Ts ayhjLbqj5Y5fWDhgGPO6a8BwWOueGJIigVaPal9JJ+0MlS360HKRS06rfOOHXF7PDlzn fkmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=+dAS2CtZ/5djlineYSND7TA0EqXJw2j7dADqHQYRWh0=; b=ZPNqosvn8KffJZP+DxD2EZ1k3cWZV5jqFnSnLStrqpXKXfvj2drSmahvZeW27zxPiG LmQJI8yTWtSgv10r79eAFwMK8ablKwOtMTOSV+jubB/mT+o/yiT5XUH6ZPyEllUhZNfg ULdRy3FLvFMiL88+Q1eeia1a4TfQHgFA9v9Kxhe6ELeLKC1bIWXrOe7wh/DdC2W0mGp5 8qow1HV059WNJPe2jCxU8kwpHv5n3MjfZ87A/e62KNLuHRFLUIavIDP7EY9gEtn6JFtf EIpU/uMd0LBn4MBJx3/c5PFKjLEvtimVXoU0CxwX1yZtsWQJmCsB8xadMlBZImM5uWN0 X1sQ== X-Gm-Message-State: AN3rC/6M9BPjweub3Xndo1wfaDRDqPGqCu8cdccgugHkEXB/osKoqEkN C/GdibLUOEFAmysz X-Received: by 10.36.103.9 with SMTP id u9mr24273625itc.44.1494304837584; Mon, 08 May 2017 21:40:37 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e34sm3765218iod.18.2017.05.08.21.40.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 May 2017 21:40:37 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #354 Date: Tue, 09 May 2017 00:42:09 -0400 Message-ID: <87y3u6k5em.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) notfixed 354 26.1 quit From unknown Tue Jun 17 01:47:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 06 Jun 2017 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator