pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Periods at end of messages.


From: Ben Pfaff
Subject: Re: Periods at end of messages.
Date: Mon, 13 May 2019 07:15:53 -0700
User-agent: Mutt/1.10.1 (2018-07-13)

On Sun, May 12, 2019 at 11:31:41AM +0200, John Darrington wrote:
> On Sat, May 11, 2019 at 08:47:36AM -0700, Ben Pfaff wrote:
>      On Sat, May 11, 2019 at 09:49:47AM +0200, John Darrington wrote:
>      > Some of our message strings end with a '.'  Whilst others do not.
>      > This is inconsistent.
>      > 
>      > The GNU Coding standards say that messages from interactive programs
>      > should not end in a period [1] .
>      > 
>      > So I'm considering this patch:
>      > 
>      > diff --git a/src/libpspp/message.c b/src/libpspp/message.c
>      > index de3dab8d..0a57e217 100644
>      > --- a/src/libpspp/message.c
>      > +++ b/src/libpspp/message.c
>      > @@ -347,6 +347,16 @@ process_msg (struct msg *m)
>      >  void
>      >  msg_emit (struct msg *m)
>      >  {
>      > +  if (m->text [strlen (m->text) - 1] == '.')
>      > +    {
>      > +      if (0 == strcmp ("C", setlocale (LC_MESSAGES, NULL)))
>      > +       {
>      > +         fprintf (stderr, "Message \"%s\" should not end in a 
> period.",
>      > +                  m->text);
>      > +         abort ();
>      > +       }
>      > +    }
>      > +
>      > 
>      > Lots of source files and tests would need to be fixed too.  Thoughts?
>      
>      I support consistency and compliance with the GNU coding standards here.
>      Please do not commit this particular implementation: it means that a
>      harmless stylistic issue crashes the program, irritates the user, and
>      spawns bug reports.
> 
> I meant to include a condition which checked that the --testing flag was
> passed, but I forgot.

If you think it's valuable in --testing mode, I don't object.

>      The standards also say that error messages that include a file name or
>      program name should not begin with a capital letter.  PSPP violates that
>      a lot too.
> 
> I think you're refering to this text:
> 
>   "The string message should not begin with a capital letter when it follows 
> a 
>   program name and/or file name, because that isn't the beginning of a 
> sentence. 
>   (The sentence conceptually starts at the beginning of the line.)  Also, it 
>   should not end with a period."
> 
> This refers to messages like: "PSPP: unknown option --xyzzy" 
> or "foo.sps: the command COX is not implemented".  It doesn't mean that
> the mere mention of a filename or program name in the message demands it
> start with a lower case.

I like your interpretation better.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]