GNU bug report logs - #354
"Added (how many lines, bytes?!) to file.txt"

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Tue, 3 Jun 2008 20:30:07 UTC

Severity: wishlist

Tags: wontfix

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #30 received at 354 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jeff Clough <kb1vqh <at> gmail.com>
Cc: 354 <at> debbugs.gnu.org
Subject: Re: "Added (how many lines, bytes?!) to file.txt"
Date: Thu, 26 Feb 2015 23:21:06 -0800
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.




This bug report was last modified 8 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.