Hi,

a style of letter case in identifiers of which I was just now
reminded (by Randy Brukardt mentioning them on c.l.ada) and
that I had seen before in different sources looks like this:

  No_of_Electrons
  King_of_Norway
  Bits_and_Pieces

I like it, so I made an initial draft version of ada-mode.el that
handles "of" etc. as part of auto casing. Since the set of words
appearing in small letters differs per natural language, and
in any case is subjective or a project's choice, this warrants
customization.

Being a draft version, setting up everything currently requires 
making two choices. They will in effect jointly set customization
variables, one as before and one new:

  ada-case-identifier
  ada-title-case-language

The first is unchanged, except for offering the new choice `ada-title-case'.
The second is new. It essentially allows selecting a list
of special words from a natural language. These settings will trigger
title case. The lists can be customized as well, the variable is

  ada-title-case-words

Patches are appended, one of them is made by GIT as I (also) have had
difficulties running patch with the output of mtn diff.
The original ada-mode.el is from org.emacs.ada-mode.stephe-2.

Any views, at all?


Some notes:

There is nothing yet in terms of file locality of the variables
set up for customize, although I don't see any that would prevent this.

Maybe setting up auto casing should be done in one comprehensive routine?

A minor optimization would place the newly selected list of title
case words in the property list of the function using it,
saving a lookup.

Will a hash table for ada-title-case-words be more convenient than
a property list?

Natural language is perhaps a more general setting?

I'm not sure if names, data structures, etc. are good. It's a draft.
I also have not done any performance testing, but when none of this
is used, then the overall impact should be that of one IF of a global
variable (the language selected being non-nil). This could be improved
by making `ada-title-case' a slightly modified copy of `ada-mixed-case',
which it now is using with a additional boolean parameter.

There are a number of natural languages to fill in! 8->


Attachment: ada-mode.git.diff
Description: Binary data


Attachment: ada-mode.mtn.diff
Description: Binary data


_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to