Extremely basic mode
This commit is contained in:
commit
ebb30679b8
3 changed files with 83 additions and 0 deletions
2
.dir-locals.el
Normal file
2
.dir-locals.el
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((nil . ((geiser-default-implementation . lips)
|
||||
(geiser-active-implementations . (lips)))))
|
||||
7
README.org
Normal file
7
README.org
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#+title: geiser-lips
|
||||
|
||||
Geiser support for [[https://lips.js.org/][LIPS scheme]].
|
||||
|
||||
Currently requires a local NodeJS install of LIPS: ~npm install -g lips@beta~.
|
||||
|
||||
This doesn't actually support any useful geiser feature currently, it's just enough to work with LIPS text files.
|
||||
74
geiser-lips.el
Normal file
74
geiser-lips.el
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
;;; geiser-lips.el --- Interop between geiser and LIPS -*- lexical-binding: t -*-
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program 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 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'geiser-eval)
|
||||
(require 'geiser)
|
||||
|
||||
(defgroup geiser-lips nil
|
||||
"Customisations for geiser-lips."
|
||||
:group 'geiser)
|
||||
|
||||
(defcustom geiser-lips-binary "lips"
|
||||
"The path to the Lips interpreter binary."
|
||||
:type 'string)
|
||||
|
||||
(defcustom geiser-lips-args '()
|
||||
"Arguments to pass to the Lips interpreter."
|
||||
:type '(list string))
|
||||
|
||||
(defun geiser-lips--parameters ()
|
||||
"Return all args for the Lips interpreter."
|
||||
geiser-lips-args)
|
||||
|
||||
(defun geiser-lips--exit-cmd ()
|
||||
"Return the exit command."
|
||||
"(exit)")
|
||||
|
||||
(defun geiser-lips--startup (remote)
|
||||
"Startup function, potentially for REMOTE."
|
||||
#t)
|
||||
|
||||
(defconst geiser-lips--prompt-rx "^")
|
||||
|
||||
(defconst geiser-lips--unsupported-procs
|
||||
'("macroexpand" "completions" "module-completions" "find-file" "symbol-location"
|
||||
"module-location" "symbol-documentation" "module-exports" "autodoc" "callers"
|
||||
"callees" "generic-methods")
|
||||
"All currently unsupported procedures.")
|
||||
|
||||
(defun geiser-lips--geiser-proc (proc &rest args)
|
||||
"Send a string to the REPL to execute PROC with ARGS."
|
||||
(let ((format (mapconcat #'identity args " ")))
|
||||
(format "(eval '(geiser:%s %s))" proc args)))
|
||||
|
||||
(define-geiser-implementation lips
|
||||
(binary geiser-lips-binary)
|
||||
(arglist geiser-lips--parameters)
|
||||
(exit-command geiser-lips--exit-cmd)
|
||||
(repl-startup geiser-lips--startup)
|
||||
(prompt-regexp geiser-lips--prompt-rx)
|
||||
(unsupported-procedures geiser-lips--unsupported-procs)
|
||||
(marshall-procedure geiser-lips--geiser-proc))
|
||||
|
||||
(provide 'geiser-lips)
|
||||
|
||||
;;; geiser-lips.el ends here
|
||||
Loading…
Add table
Add a link
Reference in a new issue