Feedback from PR

This commit is contained in:
John Andrews 2021-08-15 20:20:18 -04:00
parent 5ac5150397
commit daeb0106c5
2 changed files with 75 additions and 29 deletions

View file

@ -4,23 +4,44 @@ SuperCollider/Emacs interface
## Installation ## Installation
The repository contains two subprojects. `/sc` contains the SuperCollider code There are 3 options for installation:
required to implement the emacs interface. `/el` contains the emacs-lisp
implementation of the mode. Emacs and SuperCollider each have their own package
managers, so it is required to install each half separately.
### Installing scel quark 1. Using Emacs' and SuperCollider's own package managers (recommended)
2. From debian package `supercollider-emacs`
3. From source
The `scel` Quark is required for emacs to communicate with sclang. Evaluate this in the SuperCollider GUI: Option #1 is the best cross-platform option, and is recommended. Whatever option
you choose, you should only install from a single source.
### Install Option 1: Native Packages
The repository contains two subprojects. `/el` contains the emacs-lisp
implementation. `/scide_scel` contains the SuperCollider code required to
implement the Emacs interface. Emacs and SuperCollider each have their own
package managers, so it is required to install each half separately.
#### Installing scel quark
The `scel` Quark is required for emacs to communicate with sclang. Evaluate this
code in the SuperCollider GUI:
``` supercollider ``` supercollider
Quarks.install("https://github.com/supercollider/scel"); Quarks.install("https://github.com/supercollider/scel");
``` ```
### Installing the emacs mode The scel repository will be downloaded to your local file system and the path
will be added to your default `sclang_conf.yaml` file. If you want to change the
yaml file used by your emacs sessions you can customize the
`sclang-library-configuration-file` variable, but make sure that file loads
the scel quark.
#### Installing the emacs mode
Using [straight.el](https://github.com/raxod502/straight.el), put the following
in your init file:
Using straight.el
``` emacs-lisp ``` emacs-lisp
;; in ~/.emacs
(straight-use-package (straight-use-package
'(sclang :type git '(sclang :type git
:host github :host github
@ -33,43 +54,60 @@ Or download the repo directly to your user config directory
``` shell ``` shell
git clone https://github.com/supercollider/scel.git ~/.emacs.d/scel git clone https://github.com/supercollider/scel.git ~/.emacs.d/scel
``` ```
``` emacs-lisp ``` emacs-lisp
;; in ~/.emacs
(add-to-list 'load-path "~/.emacs.d/scel/el/") (add-to-list 'load-path "~/.emacs.d/scel/el/")
(require 'sclang) (require 'sclang)
``` ```
### On MacOS #### On macOS
If `sclang` executable is not on your path, you may need to add it to your exec-path. If `sclang` executable is not on your path, you may need to add it to your
exec-path.
``` emacs-lisp ``` emacs-lisp
(setq exec-path (append exec-path '("/Applications/SuperCollider.app/Contents/MacOS/"))) (setq exec-path (append exec-path '("/Applications/SuperCollider.app/Contents/MacOS/")))
``` ```
### On Linux
If you are building SuperCollider from source on Linux, this library (both .el ### Install Option 2: Debian package
and .sc files) will be installed by default. To disable it pass the flag
`-DSC_EL=OFF` as a `cmake` option. See the supercollider readme for more info.
There is a debian package which provides emacs integration called
`supercollider-emacs`. Option #1 will likely be more recent, but
if you prefer you can install the package with:
``` shell
sudo apt install supercollider-emacs
```
### Install Option 3: Installing from source
If you are building SuperCollider from source, you can optionally compile and
install this library along with it. The cmake `-DSC_EL` flag controls whether
scel will be compiled. On Linux machines `-DSC_EL=ON` by default. See the
supercollider README files for more info.
## Installation requirements ## Installation requirements
For the HTML help system, you will need emacs-w3m support, but you can still use without that. For the HTML help system, you will need emacs-w3m support, but you can still use
the rest of the functionality without the w3m dependency.
```emacs-lisp ```emacs-lisp
;; in ~/.emacs
(require 'w3m) (require 'w3m)
``` ```
## Configuration ## Configuration
To fine-tune the installation from within emacs' graphical customization interface, type: To fine-tune the installation from within emacs' graphical customization
interface, type:
`M-x sclang-customize` `M-x sclang-customize`
## Usage ## Usage
`M-x sclang-start` or open a `.scd` file and press `C-c C-o` Open a `.scd` file and press `C-c C-o` to start the interpreter.
You're now ready to edit, inspect and execute sclang code! You're now ready to edit, inspect and execute sclang code!
@ -84,11 +122,16 @@ and a window with key bindings in sclang-mode will pop up.
`C-x C-h` lets you search for a help file `C-x C-h` lets you search for a help file
`C-M-h` opens or switches to the Help browser (if no Help file has been opened, the default Help file will be opened). `C-M-h` opens or switches to the Help browser (if no Help file has been opened,
the default Help file will be opened).
`E` copies the buffer, puts it in text mode and sclang-minor-mode, to enable you to edit the code parts to try out variations of the provided code in the help file. With `C-M-h` you can then return to the Help browser and browse further from the Help file. `E` copies the buffer, puts it in text mode and sclang-minor-mode, to enable you
to edit the code parts to try out variations of the provided code in the help
file. With `C-M-h` you can then return to the Help browser and browse further
from the Help file.
`C-c C-e` allows you to edit the source of the HTML file, for example if you want to improve it and commit it to the repository. `C-c C-e` allows you to edit the source of the HTML file, for example if you
want to improve it and commit it to the repository.
To enable moving around in the help file with arrow keys add the following To enable moving around in the help file with arrow keys add the following
in your `~/.emacs`: in your `~/.emacs`:
@ -102,14 +145,18 @@ in your `~/.emacs`:
(define-key w3m-mode-map [down] 'next-line))) (define-key w3m-mode-map [down] 'next-line)))
``` ```
This ensures that the arrow keys are just for moving through the document, and not from hyperlink to hyperlink, which is the default in w3m-mode. This ensures that the arrow keys are just for moving through the document, and
not from hyperlink to hyperlink, which is the default in w3m-mode.
## Server control ## Server control
In the post buffer window, right-click on the server name; by default the two servers `internal` and `localhost` are available. You will get a menu with common server control operations. In the post buffer window, right-click on the server name; by default the two
servers `internal` and `localhost` are available. You will get a menu with
common server control operations.
To select another server, step through the server list by left-clicking on the server name. To select another server, step through the server list by left-clicking on the
server name.
Servers instantiated from the language will automatically be available Servers instantiated from the language will automatically be available in the
in the mode line. mode line.

View file

@ -1,7 +1,6 @@
; -*- mode: emacs-lisp; lexical-binding: t -*- ; -*- mode: emacs-lisp; lexical-binding: t -*-
;
;; Uncomment some calls below as needed for your project. ;; You can obtain eldev from https://github.com/doublep/eldev
;(eldev-use-package-archive 'gnu) ;; We use it for package development and running tests
;(eldev-use-package-archive 'melpa)
(eldev-use-plugin 'autoloads) (eldev-use-plugin 'autoloads)