Add lang/faust module (#1898)

This commit is contained in:
Bart Brouns 2019-10-14 01:23:54 +02:00 committed by Henrik Lissner
parent 25acbd29d5
commit 3f60e40f40
7 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,46 @@
#+TITLE: lang/faust
#+DATE: July 23, 2019
#+SINCE: v2.1.0
#+STARTUP: inlineimages
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#plugins][Plugins]]
- [[#features][Features]]
* Description
Add support to Faust language inside emacs.
+ Faust code syntax hightlighting and indentation
+ Project-based (inter-linked Faust files)
+ Build/compile with output window
+ Graphic diagrams generation and vizualisation in the (default) browser
+ Browse generated C++ code inside Emacs
+ Inter-linked files/buffers :
+ From "component" to Faust file
+ From "include" to Faust library file
+ From error to file:line number
+ From function name to online documentation
+ Fully configurable (build type/target/architecture/toolkit, keyboard shortcuts, etc.)
+ Automatic keyword completion (if Auto-Complete is installed)
+ Automatic objets (functions, operators, etc.) template insertion with default sensible values (if Yasnippet is installed)
+ Modeline indicator of the state of the code
** Plugins
+ [[https://bitbucket.org/yphil/faustine][faustine]]
* Features
Keybindings
| Binding | Description |
|-------------------+----------------------|
| ~<localleader> b~ | ~build~ |
| ~<localleader> c~ | ~syntax check~ |
| ~<localleader> d~ | ~diagram~ |
| ~<localleader> h~ | ~online dock~ |
| ~<localleader> RET~ | ~mdoc~ |
| ~<localleader> o~ | ~toggle output buffer~ |
| ~<localleader> s~ | ~source code~ |
| ~<localleader> r~ | ~run~ |
| ~<localleader> S-b~ | ~build all~ |
| ~<localleader> S-d~ | ~diagram all~ |

View file

@ -0,0 +1,12 @@
;;; lang/faust/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +faust-company-backend (command &optional arg &rest ignored)
"`company-mode' completion back-end for `faust-mode'."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend '+faust-company-backend))
(prefix (and (derived-mode-p 'faust-mode)
(not (company-in-string-or-comment))
(or (company-grab-symbol-cons "\\." 1) 'stop)))
(candidates faust-keywords-all)))

View file

@ -0,0 +1,29 @@
;;; lang/faust/config.el -*- lexical-binding: t; -*-
(use-package! faustine
:mode ("\\.dsp\\'" . faustine-mode)
:config
(set-company-backend! '(faust-mode faustine-mode) '+faust-company-backend)
(defadvice! +faust--suppress-ac-warnings-a (orig-fn &rest args)
"Silence obnoxious 'You really should install and use auto-complete' warnings
when starting faust-mode *and* faustine-mode. You really should *not* install
nor use auto-complete."
:around '(faust-mode faustine-mode)
(let (ac-modes ac-sources)
(apply orig-fn args)))
(map! :localleader
:map faustine-mode-map
"b" #'faustine-build
"c" #'faustine-syntax-check
"d" #'faustine-diagram
"h" #'faustine-online-doc
"RET" #'faustine-mdoc
"o" #'faustine-toggle-output-buffer
"s" #'faustine-source-code
"r" #'faustine-run
"S-b" #'faustine-build-all
"S-d" #'faustine-diagram-all
))

View file

@ -0,0 +1,5 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/faust/doctor.el
(unless (executable-find "faust")
(warn! "Couldn't find the faust compiler. faustine-mode won't work."))

View file

@ -0,0 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; lang/faust/packages.el
(package! faustine)