- /*
- Make sure they're in order of user input by adding index i.
- Don't use the direction in this priority. Smaller means closer
- to the head.
- */
- prio += index;
+ if (sym == ly_symbol2scm ("script-priority"))
+ {
+ priority_found = true;
+ /* Make sure they're in order of user input by adding index i.
+ Don't use the direction in this priority. Smaller means closer
+ to the head. */
+ int prio = scm_to_int (val) + index;
+
+ val = scm_int2num (prio);
+ }
+ if (p->internal_get_property (sym) == SCM_EOL)
+ p->internal_set_property (sym, val);
+ }
+
+ if (!priority_found)
+ {
+ p->set_property ("script-priority",
+ scm_int2num (index));
+ }