[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 4044010 060/284: Support for multiple Scheme
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 4044010 060/284: Support for multiple Scheme implementations, Chapter 1. |
Date: |
Sun, 1 Aug 2021 18:29:16 -0400 (EDT) |
branch: elpa/geiser-guile
commit 404401056c9526e2e96e08617b92f735a7e160fd
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Support for multiple Scheme implementations, Chapter 1.
* Evaluation system is now pluggable
* The rest of the system understands said pluggability
* Guile provides its own implementation (geiser-guile)
* The reload system is aware of the new kids on the block
---
elisp/geiser-guile.el | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 105 insertions(+)
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
new file mode 100644
index 0000000..fde2954
--- /dev/null
+++ b/elisp/geiser-guile.el
@@ -0,0 +1,105 @@
+;; geiser-guile.el -- guile's implementation of the geiser protocols
+
+;; Copyright (C) 2009 Jose Antonio Ortega Ruiz
+
+;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
+;; Start date: Sun Mar 08, 2009 23:03
+
+;; 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 3 of the License, 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Comentary:
+
+;; Implementation of all required Elisp Geiser protocols for Guile.
+
+;;; Code:
+
+(require 'geiser-impl)
+(require 'geiser-syntax)
+(require 'geiser-custom)
+(require 'geiser-base)
+
+
+;;; Customization:
+
+(defgroup geiser-guile nil
+ "Customization for Geiser's Guile flavour."
+ :group 'geiser)
+
+(defcustom geiser-guile-binary
+ (cond ((eq system-type 'windows-nt) "guile.exe")
+ ((eq system-type 'darwin) "guile")
+ (t "guile"))
+ "Name to use to call the Guile executable when starting a REPL."
+ :type 'string
+ :group 'geiser-guile)
+
+(defcustom geiser-guile-init-file "~/.guile-geiser"
+ "Initialization file with user code for the Guile REPL."
+ :type 'string
+ :group 'geiser-guile)
+
+
+;;; REPL support:
+
+(defun geiser-guile-parameters ()
+ "Return a list with all parameters needed to start Guile.
+This function uses `geiser-guile-init-file' if it exists."
+ (let ((init-file (and (stringp geiser-guile-init-file)
+ (expand-file-name geiser-guile-init-file))))
+ `("-p" "-L" ,(expand-file-name "guile/" geiser-scheme-dir)
+ ,@(and init-file (file-readable-p init-file) (list "-l" init-file)))))
+
+(defconst geiser-guile-prompt-regexp "^[^() \n]+@([^)]*?)> ")
+
+
+;;; Evaluation support:
+
+(defun geiser-guile-geiser-procedure (proc)
+ "Translate a bare procedure symbol to one executable in Guile's
+context. Return NULL for unsupported ones; at the very least,
+EVAL, COMPILE, LOAD-FILE and COMPILE-FILE should be supported."
+ (let ((proc (intern (format "ge:%s" proc))))
+ `(@ (geiser emacs) ,proc)))
+
+(defconst geiser-guile--module-re
+ "(define-module +\\(([^)]+)\\)")
+
+(defun geiser-guile-get-module (&optional module)
+ "Return a scheme datum representing the current module.
+If MODULE is provided, transform it to such a datum."
+ (cond ((null module)
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward geiser-guile--module-re nil t)
+ (geiser-guile-get-module (match-string-no-properties 1))
+ :f)))
+ ((listp module) module)
+ ((stringp module) (or (ignore-errors (car (read-from-string module)))
:f))
+ (t :f)))
+
+
+;;; Trying to ascertain whether a buffer is Guile Scheme:
+
+(defun geiser-guile-guess ()
+ "Return `t' if the current buffer looks like a Guile file."
+ (and (geiser-guile-get-module) t))
+
+
+;;; Register this implementation:
+
+(geiser-impl--register 'guile)
+
+
+(provide 'geiser-guile)
+;;; geiser-guile.el ends here
- [nongnu] elpa/geiser-guile f6911b5 218/284: New geiser-add-to-load-path, just for Guile right now, (continued)
- [nongnu] elpa/geiser-guile f6911b5 218/284: New geiser-add-to-load-path, just for Guile right now, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f017454 221/284: Bug fix: don't override customized geiser-implementations-alist, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 8624afc 229/284: Finishing removal of the "foo ends here" footers, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 85bf381 244/284: guile: pretty printing evaluation results (#64), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 452e096 235/284: White space, really, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 2f91e2e 245/284: Ensuring switch-to-geiser asks for an implementation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f5fee3b 255/284: Quoting binary on version checks (issue #117), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile dc8a792 257/284: Use (car (process-lines ...)) instead of (shell-command ...), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 20043b1 271/284: Make guile return line numbers more often, as suggested by Sergey, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 5eff1e4 279/284: preparing MELPA submission, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 4044010 060/284: Support for multiple Scheme implementations, Chapter 1.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile ed29f9f 103/284: Guile: bug in backtrace display fixed., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 567f3ba 129/284: Guile: dead elisp code elimination., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 23e1ec2 169/284: Documentation nits, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 5532387 171/284: Guile: remote REPLs (connect-to-guile), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7a25131 161/284: Guile: fixes for compilation error regexps, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 9ff3140 083/284: Guile: backtrace buttonization., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7b0d68b 117/284: Guile: better stack traces (using start-stack to delimit them)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 9b414b4 120/284: Missing entries in scheme/Makefile.am added., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 044c88e 134/284: Guile: small tweak., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile aaa22fb 136/284: Guile: showing again submodules in module documentation., Philip Kaludercic, 2021/08/01