<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:akira@tagoh.org" title="Akira TAGOH <akira@tagoh.org>"> <span class="fn">Akira TAGOH</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Do the right thing for intermixed edit and test elements"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=59385">bug 59385</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>akira@tagoh.org
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Do the right thing for intermixed edit and test elements"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=59385#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Do the right thing for intermixed edit and test elements"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=59385">bug 59385</a>
              from <span class="vcard"><a class="email" href="mailto:akira@tagoh.org" title="Akira TAGOH <akira@tagoh.org>"> <span class="fn">Akira TAGOH</span></a>
</span></b>
        <pre>proposed fix for this:
  <a href="http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz59385">http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz59385</a>

maybe I should export FcSubst* as FcPrivate but static function, instead of own
structure to stock the FcTest and FcEdit to reorder.

        <match>
                <test name="lang" compare="eq">
                        <string>ja</string>
                </test>
                <edit name="family" mode="append">
                        <string>foo</string>
                </edit>
                <test name="family" compare="contains">
                        <string>foo</string>
                </test>
                <edit name="family" mode="assign">
                        <string>bar</string>
                </edit>
        </match>

before applying this change:

        Loading config file
/home/tagoh/.config/fontconfig/conf.d/00-bz59385.conf
Add Subst match
        pattern any lang Equal "ja"
        pattern any family Contains "foo"
edit
        Edit family Append "foo";
        Edit family Assign "bar";
...
FcConfigSubstitute test pattern any lang Equal "ja"
FcConfigSubstitute test pattern any family Contains "foo"
No match

after applying:

        Loading config file
/home/tagoh/.config/fontconfig/conf.d/00-bz59385.conf
Add Subst match
        pattern any lang Equal "ja"
edit
        Edit family Append "foo";

Add Subst match
        pattern any family Contains "foo"
edit
        Edit family Assign "bar";
...
FcConfigSubstitute test pattern any lang Equal "ja"
Substitute match
        pattern any lang Equal "ja"
edit
        Edit family Append "foo";

Append list before  "sans-serif"(w) [insert here]
Append list after  "sans-serif"(w) "foo"(w)
FcConfigSubstitute editPattern has 3 elts (size 16)
        family: "sans-serif"(w) "foo"(w)
        lang: "ja"(w)
        prgname: "lt-fc-match"(s)

FcConfigSubstitute test pattern any family Contains "foo"
Substitute match
        pattern any family Contains "foo"
edit
        Edit family Assign "bar";

Append list before  "sans-serif"(w) "foo"(w) [insert here]
Append list after  "sans-serif"(w) "foo"(w) "bar"(w)
FcConfigSubstitute editPattern has 3 elts (size 16)
        family: "sans-serif"(w) "bar"(w)
        lang: "ja"(w)
        prgname: "lt-fc-match"(s)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>