Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for MELPA compatibility #46

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;; setting for elisp mode and elisp linter
((emacs-lisp-mode . ((fill-column . 80)
(indent-tabs-mode . nil)
(elisp-lint-indent-specs . ((describe . 1)
(it . 1))))))
19 changes: 16 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
paths-ignore:
- '**.md'
- '**.org'

jobs:
test:
Expand All @@ -15,21 +16,33 @@ jobs:
matrix:
emacs_version:
- 27.2
- 26.3
- 25.3

- 28.1
- snapshot
steps:
- name: Set up Emacs
uses: purcell/setup-emacs@master
with:
version: ${{matrix.emacs_version}}

- name: Install w3m
run: sudo apt-get install -y w3m

- name: Install Eldev
run: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/github-eldev | sh

- name: Check out the elisp source code
uses: actions/checkout@v2

# - name: Lint source code with elisp-lint
# run: |
# cd el
# eldev -p -dtT -q lint elisp-lint

- name: Lint documentation with checkdoc
run: |
cd el
eldev -p -dtT lint doc

- name: Test the uncompiled source
run: |
cd el
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ SuperCollider/Emacs interface
There are 3 options for installation:

1. Using SuperCollider Quarks (recommended)
2. From debian package `supercollider-emacs`
3. From source
2. Using an Emacs package manager
3. From debian package `supercollider-emacs`
4. From source

Option #1 is the best cross-platform option, and is recommended. Whatever option
you choose, *make sure not to mix installation methods*. In particular, do not
Expand Down Expand Up @@ -61,17 +62,19 @@ exec-path.
(setq exec-path (append exec-path '("/Applications/SuperCollider.app/Contents/MacOS/")))
```

#### Installing with an emacs package manager
### Install Option 2: Emacs package manager

It's completely possible to install with
The `sclang` package can be installed from [MELPA](https://melpa.org/#/sclang) and configured with [use-package](https://github.com/jwiegley/use-package).

It's possible to install with
[straight.el](https://github.com/raxod502/straight.el),
[use-package](https://github.com/jwiegley/use-package),
[doom](https://github.com/hlissner/doom-emacs), etc. Instructions for doing so
are beyond the scope of this README, but note that `autoloads` are implemented
for entry-point functions so if you like to have a speedy start-up time you can
use the `:defer t` option.

### Install Option 2: Debian package
### Install Option 3: Debian package

There is a debian package which provides emacs integration called
`supercollider-emacs`. Option #1 will likely be more recent, but
Expand All @@ -81,7 +84,7 @@ if you prefer you can install the package with:
sudo apt install supercollider-emacs
```

### Install Option 3: Installing from source
### Install Option 4: 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
Expand Down
5 changes: 5 additions & 0 deletions el/.dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;; setting for elisp mode and elisp linter
((emacs-lisp-mode . ((fill-column . 80)
(indent-tabs-mode . nil)
(elisp-lint-indent-specs . ((describe . 1)
(it . 1))))))
32 changes: 27 additions & 5 deletions el/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
option(SC_EL_BYTECOMPILE "Build emacs-based IDE." ON)
mark_as_advanced(SC_EL_BYTECOMPILE)

set(PKG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/SuperCollider)

file(GLOB scel_sources
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.el)

set(PKG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/SuperCollider)
list(REMOVE_ITEM scel_sources ".dir-locals.el")

# if w3m in installed locally add to the load-path
file(GLOB local-load-path
LIST_DIRECTORIES true
"$ENV{HOME}/.emacs.d/site-lisp/w3m-*"
"$ENV{HOME}/.emacs.d/elpa/w3m-*")

foreach (path ${local-load-path})
if(NOT IS_DIRECTORY ${path})
list(REMOVE_ITEM local-load-path ${path})
endif()
endforeach()

list(APPEND local-load-path ${CMAKE_CURRENT_BINARY_DIR})

# convert to string of form " dir1 -L dir2 -L dir3 ..." when more than one dir
string(JOIN " -L " load-path ${local-load-path})

# build the argument string
string(CONCAT EMACS_ARGS "-batch -L " ${load-path} " -f batch-byte-compile")

configure_file(sclang-vars.el.in
${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el)
Expand All @@ -17,6 +39,8 @@ set(all_scel_sources ${scel_sources} sclang-vars.el)

install (FILES ${scel_sources} ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el
DESTINATION share/emacs/site-lisp/SuperCollider)

# the emacs command needs to be evaled due to layers of (un)escaping required to add load-path
if (SC_EL_BYTECOMPILE)
find_program(EMACS_EXECUTABLE emacs)
if(NOT EMACS_EXECUTABLE)
Expand All @@ -25,10 +49,8 @@ if (SC_EL_BYTECOMPILE)

foreach (el ${all_scel_sources})
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c
COMMAND ${EMACS_EXECUTABLE} -batch
-L ${CMAKE_CURRENT_BINARY_DIR}
-f batch-byte-compile
${CMAKE_CURRENT_BINARY_DIR}/${el}
VERBATIM
COMMAND eval "${EMACS_EXECUTABLE} ${EMACS_ARGS} ${CMAKE_CURRENT_BINARY_DIR}/${el}"
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Creating byte-compiled Emacs lisp ${CMAKE_CURRENT_BINARY_DIR}/${el}c")
Expand Down
1 change: 1 addition & 0 deletions el/Eldev
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
;; We use it for package development and running tests

(eldev-use-plugin 'autoloads)
(eldev-use-package-archive 'melpa)
Loading