all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: npostavs@users.sourceforge.net
Cc: 354@debbugs.gnu.org, kb1vqh@gmail.com, eggert@cs.ucla.edu
Subject: bug#354: "Added (how many lines, bytes?!) to file.txt"
Date: Sat, 01 Apr 2017 09:09:04 +0300	[thread overview]
Message-ID: <83zig04q2n.fsf@gnu.org> (raw)
In-Reply-To: <87mvc021mr.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net)

> 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.





  reply	other threads:[~2017-04-01  6:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 18:37 bug#354: "Added (how many lines, bytes?!) to file.txt" jidanni
2008-06-03 21:07 ` Stefan Monnier
2008-06-06  4:02 ` Kevin Rodgers
2008-06-06 14:56   ` Drew Adams
2015-02-27  7:21 ` Paul Eggert
2015-02-27 13:52   ` Jeff Clough
2017-03-14  0:58     ` npostavs
2017-03-14 15:55       ` Eli Zaretskii
2017-04-01  4:27         ` npostavs
2017-04-01  6:09           ` Eli Zaretskii [this message]
2017-04-02  3:55             ` npostavs
2017-04-02  6:16               ` Andreas Schwab
2017-04-02 16:10                 ` npostavs
2017-04-02 15:52               ` Eli Zaretskii
2017-04-02 18:24               ` Paul Eggert
2017-04-02 18:40                 ` npostavs
2017-04-02 18:44                   ` Paul Eggert
2017-04-02 19:09                     ` npostavs
2017-04-07  2:27                       ` npostavs
2017-04-10  2:17 ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zig04q2n.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=354@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=kb1vqh@gmail.com \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.