Stylistic set diacriticals for lazy man

I have A-Z a-z and A-Zss01 a-zss.01 (default letters and a stylistic set). I have feature code to switch sets when there is a double sequence (bb ee dd etc.). I have duplicated all the letters with diacritical marks in the stylistic set. I would like to add feature code to make a switch when there is something like an e followed by an eacute or whatever, do I need to write all this, line by line in the feature code, or is somebody kind enough to tell a lazy man an easier way to get these glories? thank you.

If you use anchors for positioning of diacritics, you could decompose the accented glyphs to base glyph plus diacritic:

# e.g. in ccmp
sub [adieresis edieresis idieresis odieresis udieresis]
by  [a e idotless o u] dieresiscomb;

sub [cdotaccent edotaccent gdotaccent i iogonek j]
by [c e g idotless iogonek.dotless jdotless] dotaccentcomb;

… and then just write substitutions for the base glyphs:

# e.g. in calt
sub a a' by a.ss01;
sub e e' by e.ss01;
sub idotless idotless' by idotless.ss01;
sub o o' by o.ss01;
sub u u' by u.ss01;

The mark positioning will then take care of placing the diacritics back in the correct positon.

With the caveat that the decomposition feature is not very well supported in Adobe CC (you have to use the world-ready composer for it to work).

thank you Jens