From 889d2320d32dca68be5b45565972e48e75bef254 Mon Sep 17 00:00:00 2001 From: John Andrews Date: Wed, 16 Jun 2021 00:34:18 -0400 Subject: [PATCH 1/5] Move sclang-vars to defcustom --- el/CMakeLists.txt | 9 ++------- el/sclang-help.el | 24 +++++++++++++++++++++--- el/sclang-vars.el.in | 34 ---------------------------------- 3 files changed, 23 insertions(+), 44 deletions(-) delete mode 100644 el/sclang-vars.el.in diff --git a/el/CMakeLists.txt b/el/CMakeLists.txt index 7dc8a9e..e2934ea 100644 --- a/el/CMakeLists.txt +++ b/el/CMakeLists.txt @@ -6,16 +6,11 @@ file(GLOB scel_sources set(PKG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/SuperCollider) -configure_file(sclang-vars.el.in - ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el) - foreach (el ${scel_sources}) configure_file(${el} ${CMAKE_CURRENT_BINARY_DIR}/${el}) endforeach() -set(all_scel_sources ${scel_sources} sclang-vars.el) - -install (FILES ${scel_sources} ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el +install (FILES ${scel_sources} DESTINATION share/emacs/site-lisp/SuperCollider) if (SC_EL_BYTECOMPILE) find_program(EMACS_EXECUTABLE emacs) @@ -23,7 +18,7 @@ if (SC_EL_BYTECOMPILE) message(SEND_ERROR "Emacs could not be found.\n (If emacs interface is not required, then set SC_EL=no)") endif() - foreach (el ${all_scel_sources}) + foreach (el ${scel_sources}) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c COMMAND ${EMACS_EXECUTABLE} -batch -L ${CMAKE_CURRENT_BINARY_DIR} diff --git a/el/sclang-help.el b/el/sclang-help.el index e70a864..05706f0 100644 --- a/el/sclang-help.el +++ b/el/sclang-help.el @@ -24,13 +24,26 @@ (require 'sclang-interp) (require 'sclang-language) (require 'sclang-mode) -(require 'sclang-vars) (require 'sclang-minor-mode) -(defcustom sclang-help-directory "~/SuperCollider/Help" +(defun sclang-system-root () + "Find the common install location for the platform." + (pcase system-type + ('darwin (expand-file-name "~/Library/Application Support/SuperCollider")) +;; gnu compiled for a GNU Hurd system. +;; gnu/linux compiled for a GNU/Linux system. +;; gnu/kfreebsd compiled for a GNU system with a FreeBSD kernel. +;; darwin compiled for Darwin (GNU-Darwin, macOS, ...). +;; ms-dos compiled as an MS-DOS application. +;; windows-nt compiled as a native W32 application. +;; cygwin compiled using the Cygwin library. +;; Anything else (in Emacs 26, the possibilities are: aix, berkeley-unix, +;; hpux, usg-unix-v) indicates some sort of Unix system. + )) + +(defcustom sclang-system-help-dir (expand-file-name "Help" (sclang-system-root)) "*Directory where the SuperCollider help files are kept. OBSOLETE." :group 'sclang-interface - :version "21.3" :type 'directory :options '(:must-match)) @@ -41,6 +54,11 @@ :version "21.4" :type '(repeat directory)) +(defcustom sclang-system-extension-dir (expand-file-name "Extensions" (sclang-system-root)) + "Installation dependent extension directory." + :group 'sclang-interface + :type 'directory) + (defconst sclang-extension-path (list sclang-system-extension-dir "~/.local/share/SuperCollider/Extensions") "List of SuperCollider extension directories.") diff --git a/el/sclang-vars.el.in b/el/sclang-vars.el.in deleted file mode 100644 index 57fac1b..0000000 --- a/el/sclang-vars.el.in +++ /dev/null @@ -1,34 +0,0 @@ -;;; sclang-vars.el --- Variables with build-time defaults - -;; Copyright (C) 2005 Free Software Foundation, Inc. - -;; Author: Mario Lang - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Code: - -(defconst sclang-system-data-dir "@PKG_DATA_DIR@" - "Installation dependent data directory.") - -(defconst sclang-system-help-dir "@PKG_DATA_DIR@/Help" - "Installation dependent help directory.") - -(defconst sclang-system-extension-dir "@PKG_DATA_DIR@/Extensions" - "Installation dependent extension directory.") - -(provide 'sclang-vars) -;;; sclang-vars.el ends here From 05d10d015b6cf50146dbae5de2621a5868892b55 Mon Sep 17 00:00:00 2001 From: John Andrews Date: Wed, 16 Jun 2021 00:34:58 -0400 Subject: [PATCH 2/5] Update documentation --- README.md | 60 +++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 74a9e36..a366f6d 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,11 @@ Scel SuperCollider/Emacs interface -Installation requirements +Linux Installation requirements ------------------------- For the HTML help system, you will need emacs-w3m support. - -Installation (default) ----------------------- - By default emacs-lisp files are installed in `$prefix/share/emacs/site-lisp` @@ -33,48 +29,46 @@ For the HTML help system to fully function also add (require 'w3m) ``` - -Installation (detailed) +Installation (any platform) ----------------------- -Put all `*.el` files in emacs' load-path. e.g. if you put them in -`~/emacs/`, add the following lines to `~/.emacs` (or whatever your init -file is called): +There are 2 components to install: +1. The emacs package +1. The supercollider language extensions (as a quark) -``` -(add-to-list 'load-path "~/emacs") -(require 'sclang) -``` +## Installing emacs package + +Install as you normally would install something from melpa. -for the HTML help system to fully function also add +``` emacs-lisp +(package-install "scel") ``` -(require 'w3m) + +Or using straight.el +``` emacs-lisp +(package! scel :recipe (:host github :repo "supercollider/scel" :files ("el/*.el"))) ``` -now put all `*.sc` files in sclang's library path, e.g. if you put them -in a non-standard location, such as `~/SuperCollider/Emacs`, add the -following to `~/.config/SuperCollider/sclang_conf.yaml` (Linux) or `~/Library/Application Support/SuperCollider/sclang_conf.yaml` (macOS): +## Installing the quark +``` supercollider +Quarks.install("https://github.com/supercollider/scel"); ``` -includePaths: - [~/SuperCollider/Emacs] -``` - -(note normally this is not needed as they are put into sclang's library -path during installation with scons). +## Installing help system +For the HTML help system to fully function also add +``` emacs-lisp +(require 'w3m) +``` -Usage ------ +Configuration +----------------------- -In order to automatically start sclang when invoking emacs, use the following command line: +You may need to add the path to supercollider to your exec-path so that it can find the sclang executable. +``` emacs-lisp +(setq exec-path (append exec-path '("/Applications/SuperCollider.app/Contents/MacOS/"))) ``` -$> emacs -sclang -``` - -you're now ready to edit, inspect and execute sclang code! - Getting help ------------ From 2a7a25a306553f5f0d284080c358ae6bac8d298d Mon Sep 17 00:00:00 2001 From: John Andrews Date: Wed, 16 Jun 2021 00:35:35 -0400 Subject: [PATCH 3/5] Make a quarkfile --- .gitignore | 1 + scel.quark | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 .gitignore create mode 100644 scel.quark diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/scel.quark b/scel.quark new file mode 100644 index 0000000..7a4fc2a --- /dev/null +++ b/scel.quark @@ -0,0 +1,5 @@ +( + name: "scel", + summary: "SuperCollider/Emacs interface", + version: "1.9.9", +) From ae26ba59a74717533ea40c2846a554fe2ca02434 Mon Sep 17 00:00:00 2001 From: John Andrews Date: Wed, 16 Jun 2021 00:58:09 -0400 Subject: [PATCH 4/5] Fix docstring --- el/sclang-help.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/el/sclang-help.el b/el/sclang-help.el index 05706f0..ce7b95a 100644 --- a/el/sclang-help.el +++ b/el/sclang-help.el @@ -42,7 +42,7 @@ )) (defcustom sclang-system-help-dir (expand-file-name "Help" (sclang-system-root)) - "*Directory where the SuperCollider help files are kept. OBSOLETE." + "Directory where the SuperCollider system help files are kept." :group 'sclang-interface :type 'directory :options '(:must-match)) From eaba672ec22baf491886633023174f982b7aee7b Mon Sep 17 00:00:00 2001 From: John Andrews Date: Wed, 21 Jul 2021 13:10:24 -0400 Subject: [PATCH 5/5] Add linux system type --- el/sclang-help.el | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/el/sclang-help.el b/el/sclang-help.el index ce7b95a..5edbcd3 100644 --- a/el/sclang-help.el +++ b/el/sclang-help.el @@ -30,16 +30,9 @@ "Find the common install location for the platform." (pcase system-type ('darwin (expand-file-name "~/Library/Application Support/SuperCollider")) -;; gnu compiled for a GNU Hurd system. -;; gnu/linux compiled for a GNU/Linux system. -;; gnu/kfreebsd compiled for a GNU system with a FreeBSD kernel. -;; darwin compiled for Darwin (GNU-Darwin, macOS, ...). -;; ms-dos compiled as an MS-DOS application. -;; windows-nt compiled as a native W32 application. -;; cygwin compiled using the Cygwin library. -;; Anything else (in Emacs 26, the possibilities are: aix, berkeley-unix, -;; hpux, usg-unix-v) indicates some sort of Unix system. - )) + ('gnu/linux (if (file-exists-p "/usr/local/share/SuperCollider") + "/usr/local/share/SuperCollider" + "/usr/share/SuperCollider")))) (defcustom sclang-system-help-dir (expand-file-name "Help" (sclang-system-root)) "Directory where the SuperCollider system help files are kept."