lout-users
[Top][All Lists]
Advanced

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

hyphenation of programming language identifiers


From: Jeff Kingston
Subject: hyphenation of programming language identifiers
Date: Sat, 16 Aug 2008 08:44:25 +1100

Some time ago, Mark Summerfield put in a request for hyphenation
of programming language identifiers at points where they change
from lower to upper case, as in foo&-Bar; he also sugggested after
/ and after _ as hyphenation points.

This raises some issues that I hope people on the mailing list
will consider.  It would be good to do something for the next
release, if we are going to do anything at all.

I suppose most of us who include programming language fragments in
our documents have struck the problem of identifiers, especially
long ones, fitting badly into lines, and this proposal addresses
that problem.  I rewrite my paragraphs in these cases, but that
is a very tedious solution.

I assume that hyphenation is wanted only within identifiers, not
within strings, numbers, keywords, etc.

Are there problems with allowing hyphenation of programming
language identifiers at all?  What if the *default* behaviour
is altered to allow hyphenation, with an option to turn it off?

If hyphenation is allowed, what options are needed?  Do we need
both of the choices of hyphenating in the current language or
hyphenating according to special rules?  If we need to be able
to hyphenate according to special rules, what should the rules
be?  Mark's suggestions above, or others?

It's best not to worry about how all this could be implemented
at this stage, but for the record here is what I have in mind.
Define a new @Language called Programming with its own set of
hyphenation rules (not difficult).  At present, @CP and all the
other programming language symbols have "nohyphen" inside them.
Adding "hyphen @Break" to the symbol used behind the scenes to
control the formatting of identifiers would cause identifiers to
be hyphenated as though they were words of the current language.
Adding "Programming @Language" would hyphenate according to the
special rules.  Then options could be used to turn these things
on and off at the user's choice.

Owing to implementation problems, I would prefer to avoid the
option of adding extra hyphenation points to the points already
present in the current language.  Still, if anyone is attached
to that idea, now's the time to say so.

Jeff

ps I will be away all next week and not responding to email.


reply via email to

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