This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to format an error?


> 
> On Sun, 13 Jan 2002, Andrew Cagney wrote:
> 
> > Given the attached, which is the correct way of formatting an error message:
> > 
> > 	This is an error message.
> > 	this is an error message.
> > 	This is an error message
> > 	this is an error message
> 
> I suggest the last variant.  It goes with the GNU coding standards
> except for the capitalization.  But capitalization is
> language-specific (e.g., in German, all nouns are capitalized), and it
> was recently discovered in Emacs development that a 100% adherence to
> the capitalization rule you cited produces wrong results in some
> cases.  Most of the messages don't need caps, so I think losing that
> is the best alternative which is simple enough to adher to.

Hmm, I'd go for the third.  If the message were to appear in a GUI box, it 
could well be a line of text on its own, such as

         ************* ERROR **************
         *                                *
         *    This is an error message    *
         *                                *
         **********************************

In such a context I think it would be very wrong to start this with a 
lower-case letter.

However, exceptions:

strings extracted from user code shouldn't have the case changed, so

print foo

error: Foo doesn't exist

would be wrong.  Though I think this should be "'foo' doesn't exist"

Given that, (and that a litteral will never appear in the first letter) 
can we safely assume that we can capitalize the first letter during 
printing?  If so, we could mandate that all messages in the source code 
should start with a lower case letter (except where other capitalization 
rules apply) and then have the UI output routine capitalize the first 
letter as appropriate for the output stream?

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]