- for (SCM s = me->get_grob_property ("extremity-rules");
- s != SCM_EOL; s = ly_cdr (s))
- {
- SCM r = gh_call2 (ly_caar (s), me->self_scm (),
- gh_int2scm ((int)dir));
- if (r != SCM_BOOL_F)
- {
- index_set_cell (att, dir,
- ly_cdar (s));
- break;
- }
- }
+ SCM p = me->get_property ("extremity-function");
+ SCM res = ly_symbol2scm ("head");
+
+ if (gh_procedure_p (p))
+ res = gh_call2 (p, me->self_scm (), gh_int2scm (dir));
+
+ if (gh_symbol_p (res))
+ index_set_cell (att, dir, res);