Subject: Re: bug#58150: 29.0.50; parse_tool_bar_item should not usually upcase "and"

From: Gregory Heytings <[email-masked]>
Date: Thu, 29 Sep 2022 23:00:56 +0000

>> Otherwise somebody could, of course, just write a function that 
>> capitalises titles correctly according to one or other of the English 
>> title capitalisation standards -- which isn't difficult, and would be 
>> generally useful.
>
> I'm not sure it's so simple, actually, and I think your first suggestion 
> is preferable.  For example, "Go To Node" in the Info toolbar is 
> probably correct, because it's a whole phrasal verb, but in other 
> contexts, "to" in titles isn't capitalised.
>

Indeed, it's not easy, and can probably not be mechanized, because whether 
a word should be capitalized or not may depend on its semantics.  The CMOS 
gives the following rules (I removed some parts that are not important in 
the context of Emacs):

1. Capitalize the first and last words in titles and subtitles, and 
capitalize all other major words (nouns, pronouns, verbs, adjectives, 
adverbs, and some conjunctions---but see rule 4) .

2. Lowercase the articles _the_, _a_, and _an_.

3. Lowercase prepositions, regardless of length, except when they are used 
adverbially or adjectivally (_up_ in _Look Up_, _down_ in _Turn Down_, 
_on_ in _The On Button_, _to_ in _Come To_, etc.).

4. Lowercase the common coordinating conjunctions _and_, _but_, _for_, 
_or_, and _nor_.

5. Lowercase _to_ not only as a preposition (rule 3) but also as part of 
an infinitive (_to Run_, _to Hide_, etc.), and lowercase _as_ in any 
grammatical function.