Symptom: (sclang-eval-sync "\"ö\"") evaluates to "ö"
After this patch: (sclang-eval-sync "\"ö\"") => "ö"
This was tricky to figure out, so here is a bit of background.
scel uses a so-called command FIFO to send (amongst other things) evaluation
results to Emacs. This FIFO uses a pascal-string (32bit string length
followed by character data) to send Lisp to Emacs. The command process
coding system is already set to 'no-conversion on the Emacs side
to avoid crippling the int32 at the beginning of every string.
However, the read-from-string call in sclang-command-process-filter
implicitly converts the unibyte string received from the process to
a multibyte string, without doing proper conversion.
The right function to use here is string-as-multibyte, which does
the correct conversion.
What I've done to fix this:
- add a sclang-class-list variable in sclang-language.el, which is a
list of all the classes known to sclang. this is populated when
sclang starts.
- update sclang-font-lock-class-keyword-matcher in
sclang-mode.el. since the sclang-class-name-regexp now will match
all words that start with a capital letter (see next bullet point
for that change), this function had to be updated to check to make
sure that the word starting with a capital letter is in the list of
classes. if it is, then we know it's a class and it gets
highlighted. if it's not, then it's just something the user typed
with a capital letter, so we don't highlight it.
- update sclang-update-font-lock in sclang-mode.el. instead of
generating a huge regexp from a list of all the classes in
SuperCollider, just run the normal fontification from that
function. this avoids making the regexp too big and thus prevents
fontification from failing.
Sublime Text syntax grammar does not do multi-line matching,
so all editors that use this (including Atom and its symbol matching)
cannot detect classes defined as
MyClass
{
}
This also makes all classes in the class lib consistent in style which is nice
for everybody.
`(force-mode-line-update)` updates only the mode-line of the current buffers. Providing a non-nil argument updates the mode-line of all buffers. This is particularly useful when having a split view with the server buffer and another buffer where current buffer is not the server buffer. (probably a very common use case).
This merges the Document and ScIDEDocument classes. This should improve readability and maintainability, and simplifies the implementation. As part of this:
- some duplicate methods are deprecated
- the previous Document has been copied into the scel folder to avoid breaking EmacsDocument
Signed-off-by: Scott Wilson <i@scottwilson.ca>
This library is part of Emacs. Bundling it in the same directory as
the sclang*.el libraries will put it on the load-path. The bundled
version then shadows the newer version which is part of Emacs, which
can cause hard to detect problems.
scel currently uses method overwrites to control the IDE gui. this can be
avoided by using actions, which can be set in order to override the default
behavior
Signed-off-by: Tim Blechmann <tim@klingt.org>
UI.registerForShutdown has the same semantics as ShutDown.add. we only
need one functionality like this, so this patch deprecates it.
Signed-off-by: Tim Blechmann <tim@klingt.org>
this patch introduces two new key bindings:
C-c C-y: open help browser via Help.gui
C-c h: open help browser for a specific topic
the old help browser is still available via C-c C-h and can be used to
display pre-rendered help files.
Signed-off-by: Tim Blechmann <tim@klingt.org>
When sclang recompiled the class library, it would close its writing
end of the fifo, which in turn would trigger fifo deletion in scel.
This starts a dummy cat process with output redirected to the fifo,
so as to keep the fifo open as long as we desire.