Frank Mittelbach wrote:
> where is the solution Donald? this should be the kind of problem you like to
> tackle, or not?

I would have the inputenc active characters begin with

\ifx\protect\typeset@protect
  \ifvmode \leavevmode \fi
  \ifmmode
    make math character
  \else
    make text character
  \fi
\else
  \protect something
\fi

A)  When \halign is expanding text looking for \omit, TeX is
in inner vertical mode, so the \leavevmode would be executed
(\unhbox\voidb@x), and the expansion stopped there.

B)  When an active character appears in vertical mode, it will
start the paragraph (executing \everypar) before it makes font
settings or begins a local group.

C)  When already in a paragraph, ligatures and kerns are preserved

D)  When moving, the character is protected for later processing.

E)  When \halign is expanding text looking for \omit, \protect had
better be \typeset@protect!  Strange implementations that subvert
\halign making \protect be \noexpand during pre-expansion, and
changing it to \relax in every alignment template need no sympathy.

The pedantic may point out "bugs" with this approach, that I don't
think are worth consideration, when the alignment template contains
text:

{>{f}l}
 licker\\
 lame\\
 risky

(except with inputenc characters)

Of course there are probably serious bugs because I am an idiot :-)



Donald Arseneau                          [log in to unmask]