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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: 354 <at> debbugs.gnu.org, kb1vqh <at> gmail.com, eggert <at> cs.ucla.edu
Subject: bug#354: "Added (how many lines, bytes?!) to file.txt"
Date: Sat, 01 Apr 2017 09:09:04 +0300
> From: npostavs <at> users.sourceforge.net
> Cc: 354 <at> debbugs.gnu.org,  kb1vqh <at> gmail.com,  eggert <at> 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.




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.