Emacs SCEL code block evaluation

Having the same issue, seems to me like scel fails at finding and matching parentheses, and then evaluating everything enclosed.
Like Bubo above the behavior I expected is:

  • When the cursor is inside a block defined with parentheses, scel would look above and below the current line, find outermost enclosing parentheses and evaluate all enclosed code. (IDE behaviour?)

I have tried to pinpoint how the scel functions work, but behavior is all over the place… It is hard to reliably troubleshoot, but:

  • With sclang-eval-region-or-line, scel evaluates the line, unless code is selected (visual mode with evil)
  • With sclang-eval-region, moves from the current line downwards, and evaluates. This means that if the cursor is placed on the opening parenthesis, the code block is evaluated. However, this only seems to work on the first code block in a given file(!). The second or third code block would not work.
  • While testing this, the behavior seems to break down further: suddenly, evaluating the second code block gives me the expected return of the first block, while the first evaluates to nil, and the third throws an error…

With this behavior, it seems like scel currently is restricted to evaluation of either single lines or visually selected blocks of code?

EDIT: There is an issue open on github that mirrors this question: https://github.com/supercollider/scel/issues/29

I am curious if anyone is using scel with an Emacs config other than doom that could give some indication whether this might be an issue with doom?

1 Like