New issue: typo in sclang argument construction for scide_scel, and failure of correct argument to work with EMACS on MacOS

Hello,
after naming the scel directory to scide_scel in Extensions, it fails to compile on EMACS on MacOS.
I am running MacOS 10.14.6 with SuperCollider 3.11.1.

Additionally, the option string is wrongly constructed on latest version of scel. I tested the corrected version and opened an issue for the correction. Please check that it works on MacOS - perhaps something else is wrong on my system.

I tested the behavior of the sclang compilation on both systems with different folder names for scel. Results are as follows:

  • if the scel folder is named scide_scel, then it is ignored by QT IDE and sclang works on it - but it is also ignored by EMACS and sclang does not work.

  • if the scel folder is named something else, such as “scel”, then it is compiled by both QT IDE and EMACS, and sclang reports discrepancy on QT IDE, but EMACS works.

Details below.

Iannis Zannos

In scel/el/sclang-interp.el on line 304, the function sclang-make-options is made to create options as:
(list "-iscel")
But it should be:
(list “-i scel”)
(see post by jamshark70 on forum here: How to switch back and forth from SC_IDE to EMACS on MacOS?)

Additionally, even the correct arguments “-i scel” will not work when starting the sclang process from emacs with the correct options. I have verified that the options are “-i scel” on terminal (see attached screenshot!). However, the scide_scel directory in my Extensions folder is ignored by sclang, and consequently sclang fails to connect to emacs.

Process arguments of sclang started from emacs:

Applications/SuperCollider/SuperCollider.app/Contents/MacOS/sclang -i scel

Screenshot:

Contents of scide_scel folder in my Application Support/SuperCollider/Extensions directory:

first, it doesn’t matter if you use -iscel or -i scel, they are exactly the same. this is common for Linuxy command line interfaces.

second, what is the actual output you see from sclang when you run /Applications/SuperCollider/SuperCollider.app/Contents/MacOS/sclang -i scel? don’t start it through sc-el, just run it on the command line. i tried this locally and i cannot reproduce your issue. this section of the interpreter code has been tested thoroughly and i suspect the issue is with your system rather than sclang, but i could be wrong.

here is what i did to test:

[brianheim@BrianMBP sc]$ /Applications/SuperCollider.app/Contents/MacOS/sclang -iscel
compiling class library...
	Found 850 primitives.
	Compiling directory '/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary'
	Compiling directory '/Library/Application Support/SuperCollider/Extensions'
	Compiling directory '/Users/brianheim/Library/Application Support/SuperCollider/Extensions'
Expected class name.  got token: 'alskdflaksdjf' 258
  in file '/Users/brianheim/Library/Application Support/SuperCollider/Extensions/scide_scel/sc/Test.sc'
  line 1 char 0:


  ^^^^^^^^^^^^^
-----------------------------------
[brianheim@BrianMBP sc]$ cat "/Users/brianheim/Library/Application Support/SuperCollider/Extensions/scide_scel/sc/Test.sc"
alskdflaksdjf

Thanks for answering. To find out why EMACS is not responding in my system, I tested SCClassLibrary compilation behavior with the -i command option, after adding postln messages to StartUp in the initClass methods of ScIDE the standard SCClassLibrary and 'EmacsInterface in the scel extension. This makes it possible to trace through the output of the terminal execution of sclang which parts of the library are executed, in order to distinguish between the 4 possible cases:

  1. sclang tries to compile both ScIDE and EmacsInterface. (results in ERROR: Duplicates found, and sclang is unresponsive).
  2. sclang compiles only the ScIDE class (works in QT IDE, is unresponsive in EMACS)
  3. sclang compiles only the EmacsInterface class (works in EMACS, does not work in QT IDE).
  4. sclang compiles none of the two interface libs. (sclang compiles, but is unresponsive both in QT IDE and in EMACS).

Also, regarding the -i option settings, @jamshark70 noted that the option for qt should be -i scqt (see comments to How to switch back and forth from SC_IDE to EMACS on MacOS? )
Here are the results of my tests from the QT IDE and from the command line, following your instructions. I test here both cases: 1. With scel directory placed in Extensions and named xscel and 2. with scel directory named scide_scel. I test both of these from the QT IDE and from the command line, following the method which you suggested, with 3 options (!): -i scel, -i scqt and -i scide. While -i scide was not mentioned, it serves here to test what happens when an arbitrary non-matching option is given.
I tested the following 10 cases in all, listed in the table below together with the resulting behavior, and whether the EMACS interface classes are compiled in the SCClassLibrary. (Note: xscel and scide_scel are the names given to the scel directory placed inside Extensions):

| No.| dir. name  | command arg/IDE  | RESULT       | Libs compiled  |
| 1  | xscel      | -i scel          | compiles OK  | EmacsInterface | 
| 2  | xscel      | -i scqt          | Discrepancy  | NONE           |
| 3  | xscel      | -i scide         | compiles OK  | EmacsInterface |
| 4  | xscel      | QT IDE           | Discrepancy  | NONE           |
| 5  | xscel      | EMACS            | compiles OK  | EmacsInterface |
| 6  | scide_scel | -i scel          | compiles OK  | EmacsInterface |
| 7  | scide_scel | -i scqt          | compiles OK  | ScIDE          |
| 8  | scide_scel | -i scide         | compiles OK  | NONE !!!!!!!!! |
| 9  | scide_scel | QT IDE           | compiles OK  | ScIDE |
| 10 | scide_scel | EMACS            | compiles OK  | NONE !!!!!!!!! |

Interestingly, while with directory named scide_scel, the command

/Applications/SuperCollider/SuperCollider.app/Contents/MacOS/sclang -i scel

compiles the EmacsInterface on terminal, the same command fails to compile it on EMACS. I checked this through the output of sclang on the terminal vs. the EMACS post window, and cross-checked that the command used by EMACS to create the sclang process was identical to the above, by running

ps -ef | grep sclang

I cannot explain this - and ask for your help here.

Conclusions:

A. scel folder named something other than scide_scel

  1. EMACS can be used
  2. QT IDE cannot be used.
  3. -i scel and -i scide compile EmacsInterface while -i scqt tries to compile both interfaces.

B. scel folder named scide_scel

  1. QT IDE can be used.
  2. EMACS cannot be used.
  3. -i scel compiles EmacsInterface on command line, but none of the interfaces on EMACS. -i scide compiles none of the interfaces on command line. -i scqt compiles the ScIDE interface on command line.

I would be very grateful if someone else could test EMACS vs QT IDE behavior on MACOS with the scide_scel folder, as I currently cannot find any other explanation for the above problem. In the PS below I add a hint about another possible cause of the problem - namely that the sclang process does not connect to EMACS after it compiles, but I cannot debug this myself.

Thank you very much in advance.

Iannis Zannos

PS: The output of the terminal command and the corresponding command run on emacs are listed below for reference:

  1. terminal command:
/Applications/SuperCollider/SuperCollider.app/Contents/MacOS/sclang -i scel

Output of above command:

compiling class library...
	Found 850 primitives.
	Compiling directory '/Applications/SuperCollider/SuperCollider.app/Contents/Resources/SCClassLibrary'
	Compiling directory '/Users/iani/Library/Application Support/SuperCollider/Extensions'
	Compiling directory '/Users/iani/Library/Application Support/SuperCollider/downloaded-quarks/Vowel'
	Compiling directory '/Users/iani/Library/Application Support/SuperCollider/downloaded-quarks/Dirt-Samples'
	Compiling directory '/Users/iani/Library/Application Support/SuperCollider/downloaded-quarks/SuperDirt'
	numentries = 995941 / 14949774 = 0.067
	6033 method selectors, 2478 classes
	method table size 16059808 bytes, big table size 119598192
	Number of Symbols 13599
	Byte Code Size 412543
	compiled 445 files in 0.91 seconds

Info: 5 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll

compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Emacs: No communication FIFO available.
Class tree inited in 0.01 seconds
Emacs Interface was compiled

  1. Emacs command - identical to above according to ps -ef | grep sclang

Output posted on EMACS SCLang Postbuffer:

compiling class library...
	Found 850 primitives.
	Compiling directory '/Applications/SuperCollider/SuperCollider.app/Contents/Resources/SCClassLibrary'
	Compiling directory '/Users/iani/Library/Application Support/SuperCollider/Extensions'
	Compiling directory '/Users/iani/Library/Application Support/SuperCollider/downloaded-quarks/Vowel'
	Compiling directory '/Users/iani/Library/Application Support/SuperCollider/downloaded-quarks/Dirt-Samples'
	Compiling directory '/Users/iani/Library/Application Support/SuperCollider/downloaded-quarks/SuperDirt'
	numentries = 978819 / 14467250 = 0.068
	5905 method selectors, 2450 classes
	method table size 15717600 bytes, big table size 115738000
	Number of Symbols 13289
	Byte Code Size 401989
	compiled 435 files in 0.84 seconds

Info: 5 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll

compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Class tree inited in 0.01 seconds

The missing line

Emacs Interface was compiled

indicates that EMACS failed to compile the library - although the problem may be that after sclang compilation, emacs fails to connect to the sclang process and thus cannot post any messages from sclang after startup. Could that be the problem?

1 Like

The problem has been solved now!

After testing the cases below, I found out that the source of my problem was in the use of a possibly older version of the el part of scel. I copied the el part to the location which loaded the sclang package on my EMACS. I can now start and use sclang both on SC QT IDE and on EMACS, with the same directory scide_scel placed in Extensions. As discussed earlier, I will look at the documentation both on the github repository and in the help files for SCLang, in order to explain the setup and behavior and dependencies in a better way for other users.

Thanks a lot to @VIRTUALDOG and @jamshark70 for their responses which gave much light on the way to find the solution.

Iannis Zannos

1 Like