commit ebb30679b84ea41fd88d4c65cb57015dbe82b7e7 Author: BirDt_ Date: Sat Jul 11 09:50:03 2026 +0800 Extremely basic mode diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..c42bc52 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,2 @@ +((nil . ((geiser-default-implementation . lips) + (geiser-active-implementations . (lips))))) diff --git a/README.org b/README.org new file mode 100644 index 0000000..b528292 --- /dev/null +++ b/README.org @@ -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. diff --git a/geiser-lips.el b/geiser-lips.el new file mode 100644 index 0000000..f17a30d --- /dev/null +++ b/geiser-lips.el @@ -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 . + + +;;; 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