Commit graph

72 commits

Author SHA1 Message Date
Marcin Pączkowski
d8296a9af5
Merge pull request #39 from jxa/packaging
Allow installation via package managers
2021-09-04 09:44:53 -07:00
John Andrews
cbd89755e8 README clarifications
Also, autoload `sclang-customize`, as that should be able to be called
interactively regardless of whether sclang is started
2021-09-04 09:46:59 -04:00
John Andrews
4852752d67 Add a test for the autoloading behavior 2021-08-19 21:23:54 -04:00
John Andrews
8503b2a3e2 Better autoloads
Add autoloads which will cause whole sclang package to be loaded.
2021-08-19 13:26:51 -04:00
John Andrews
19dfecc8ca Revert "Combine sclang-mode into the main sclang file"
This reverts commit c414b9c7ab.
2021-08-16 19:57:43 -04:00
John Andrews
daeb0106c5 Feedback from PR 2021-08-15 20:20:18 -04:00
John Andrews
c414b9c7ab Combine sclang-mode into the main sclang file
Because the only autoloaded function is sclang-mode, the sclang file was
not being evaluated. This made it impossible to use-package properly in
order to configure the package. Combining the files makes the most sense
as sclang.el wasn't doing much anyways.
2021-08-09 22:34:47 -04:00
John Andrews
9b160ec102 Fix the load issue by unwrapping requires 2021-08-09 12:05:52 -04:00
John Andrews
14157663b0 Add test to expose a load-time issue
The issue manifests when sclang is compiled. Steps to reproduce in real
emacs config:
1. Install the package and compile it
2. Open a file with a `.sc` or `.scd` extension
3. Witness the error `(void-function sclang-make-buffer-name)`

Steps to reproduce with the test:
0. install [eldev](https://github.com/doublep/eldev#installation)
1. `eldev compile`
2. `eldev test`
2021-08-09 11:57:27 -04:00
John Andrews
6cea8929e6 Conditionally respect sclang-vars
Only when compiling with cmake will sclang-vars.el be written. This
commit moves relevant constants into customizable vars. Only if the
`sclang-system-data-dir` exists is it respected, otherwise it will guess
the proper location by looking at the system-type.

The purpose of this is to make it possible to build and distribute a
package independent of the SuperCollider build process, while ensuring
that those users who have become accustomed to the current install
process are not disrupted.
2021-07-25 19:54:19 -04:00
Mario Lang
9d6067b2e5
Merge pull request #26 from supercollider/topic/ninja
cmake: fix ninja toolchain
2021-07-23 09:19:34 +02:00
Brian Heim
a85032e5fb cmake: fix ninja toolchain
When CMake is run with ninja as the generator, duplicate target names
are generated that cause configuration to fail. This commit fixes that
by adding a "compile_" prefix to each of the byte-compiled target names,
eliminating the naming collision.
2020-04-10 14:17:59 -05:00
Brian Heim
0e95a1884d
Merge pull request #25 from mlang/emacs25
Use `cl-gensym' to fix Emacs 25 compatibility (Fixes #24)
2020-04-02 09:05:01 -05:00
Mario Lang
6739aa327c Use `cl-gensym' to fix Emacs 25 compatibility (Fixes #24)
`gensym' used to be an alias for `cl-gensym'.
It was replaced with a "native" implementation in subr.el with Emacs 26.1.
Go back to using `cl-gensym' to make sure Emacs 25 still works.
2020-04-02 08:29:01 +02:00
TatriX
8472f03dbf Use define-derived-mode from prog-mode and update auto-mode-alist 2020-03-25 23:14:32 +01:00
TatriX
7bfbd1929d scel: Add support for completion-at-point-functions and company-mode 2020-02-26 17:10:07 +01:00
Mario Lang
e43da1aa99 Fix a number of overlooked obsolete aliases
For some reason, these slipped my attention.  Sorry about that.
Also:
* `nconc' is more efficient then `append' if destructive modification is not
  an issue.
* Emacs 26 actually deprecated `string-as-multibyte' in favour of
  `decode-coding-string' since the latter actually forces the user to
  specify an encoding.
2019-12-26 11:12:53 +01:00
Mario Lang
bb6bce1671 Use cl-lib instead of obsolete cl package
This is actually pretty boring.  It replaces calls to obsolete aliases
with the properly namespaced functions from the cl-lib package.

This raises our minimal Emacs version requirement to 24.3 (2013-03-10).
However, people using earlier versions can install the cl-lib package
from the Emacs package system.

While at it:
* remove function `sclang-document-list' which was really useless.
* fix `sclang-format-pseq' which needed to use `cl-labels'
  instead of `cl-flet' to actually work.
* (cl-reduce (lambda (a b) (or a b)) (mapcar function list))
  is much better written as (and now properly short-circuits):
  (cl-some function list)
* (cl-remove-if 'null list)
  should be written as
  (remq nil list)
2019-12-25 14:14:13 +01:00
Mario Lang
59e0d31b0a Fix `sclang-make-options' falsely emitting -d and -l
It turns out `file-directory-p' and `file-exists-p' return t when passed
the empty string.  This is sort of unexpected, and leads to the logic
in `sclang-make-options' choosing to pass -d and -l with
unpredictable values (default-directory) to sclang.
A default of "" (or -1) is pretty unidiomatic for elisp, so we change
the default of user option `sclang-runtime-directory',
`sclang-library-configuration-file' and `sclang-udp-port' to
nil, and adjust `sclang-make-options' accordingly.  While we're here,
we can eliminate the use of `cl-flet'.
Additionally, `sclang-eval-sync' uses `find' which is really an
alias for `cl-find' which and can be replaced with a call to the built-in
function `assoc'.  This is faster, and the last dependency on the
cl package, which we can now remove (obsolete since emacs 27).
2019-12-24 23:18:08 +01:00
Mario Lang
7285fb3358 Fix decoding of evaluation results to support multibyte characters
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.
2019-12-17 08:32:05 +01:00
Mario Lang
7fbce73e7f Update my email address 2019-12-12 10:37:11 +01:00
Brian Heim
7ec76e4c02
Merge pull request #9 from widp/flet-macro-change
change instances of flet to cl-flet as flet is obsolete
2018-08-02 20:46:51 -05:00
widp
95120e310b change instances of flet to cl-flet as flet is obsolete 2018-07-28 20:01:58 +05:30
widp
3ddfd3e677 Revert "Fixes link to "HelpSource" directory"
This reverts commit 5abf055a10.
2018-04-05 17:27:56 +05:30
tejaswidp
5abf055a10 Fixes link to "HelpSource" directory 2018-03-30 21:53:40 +05:30
tejaswidp
b12547a152 install *.el files irrespective of byte compilation option 2018-03-30 17:43:21 +05:30
modula t. worm
c52e2912b6 populate sclang-class-list 2016-11-21 17:37:37 -06:00
modula t. worm
16835a43e2 Prevent Emacs fontification failure w/ lots of classes - Fixes #248
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.
2016-11-21 17:13:01 -06:00
Martin Marier
6d6ec77634 Fix bug #132
Fix #132.  Incorrect regexp caused methods names with a capital letter to be interpreted as a class name.  Adding a start of word \\< seems to fix it.
2016-10-05 03:51:37 -03:00
Peter Vasil
023b5a41c6 scel: Fix mode-line update
`(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).
2015-09-30 21:32:16 +02:00
bion
3ca01e04ed Highlight uppercase symbols in emacs 2014-10-15 00:31:48 -07:00
Jonas Bernoulli
6f808bcece remove bundled elisp library tree-widget.el
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.
2013-05-09 17:03:03 +02:00
Dan Stowell
ca2a432409 Improve error messages when cmake can't find optional things 2012-09-07 12:12:36 +01:00
Tim Blechmann
494cf1fe11 editors: scel - disabling bytecode compilation is an advanced option
Signed-off-by: Tim Blechmann <tim@klingt.org>
2012-03-07 23:34:01 +01:00
Tim Blechmann
f5f09b6090 editors: scel - do not require emacs when omitting bytecode compilation
Signed-off-by: Tim Blechmann <tim@klingt.org>
2012-03-07 23:34:01 +01:00
Tim Blechmann
dfb69f398b scel: add option to install without bytecode compilation
Signed-off-by: Tim Blechmann <tim@klingt.org>
2012-03-05 17:43:06 +01:00
Tim Blechmann
67d100d7d7 scel: install files to site-lisp/SuperCollider
adapted patch from debian package

Signed-off-by: Tim Blechmann <tim@klingt.org>
2012-03-05 17:43:06 +01:00
Tim Blechmann
1569625efa editors: scel - move code from el to sc to avoid method overwrite
we can simply call the library shutdown handler from within emacs to avoid
a method overwrite.

Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-12-08 19:46:51 +01:00
Tim Blechmann
3e5cf00140 scel: avoid temporary file for symbol table
the symbol table can simply be passed via the command fifo, there is no
need for using a temporary file.

Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-10-10 21:00:39 +02:00
Tim Blechmann
fef0729223 scel: improvements to the scdoc integration
Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-10-01 18:35:53 +02:00
Tim Blechmann
a20081f26a scel: initial support for SCDoc help browser
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>
2011-10-01 11:33:24 +02:00
Jakob Leben
65b6928a97 scel: keep command fifo alive for the lifetime of sclang
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.
2011-09-25 18:23:29 +02:00
Tim Blechmann
d91e92f53f scel: shutdown library before class library recompilation
Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-09-20 14:44:37 +02:00
Tim Blechmann
b64f936a3e scel: use xdg-compliant paths
Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-09-20 14:44:37 +02:00
Tim Blechmann
c66a01f782 scel: one more bytecode compilation fix
Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-07-23 16:27:17 +02:00
Tim Blechmann
ac41f5ed3e scel: bytecompilation fix
Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-07-23 16:25:46 +02:00
Tim Blechmann
83d0d94a1a scel: bytecompile fix, correct use of defvar and defconst and add requirements
Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-07-22 20:35:00 +02:00
Tim Blechmann
5aa9b34534 scel: work around some warnings and avoid some deprecated functions
Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-07-19 12:32:48 +02:00
Tim Blechmann
6726ce6618 scel: use in-process library recompilation
scel is modified to support in-process library recompilation. the key
binding has slightly been changed:
C-c C-l - recompile the library
C-c C-o - restart the interpreter

Signed-off-by: Tim Blechmann <tim@klingt.org>
2011-06-27 21:50:03 +02:00
Dan Stowell
fe8524e1f9 Improve format of copyright/GPL notices (issue raised in debian pkging)
Similar to commit dc73e034cfafd in 3.4 branch
2011-06-14 10:48:37 +01:00