[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gauche f9064d8 003/119: Implement get-module and ot
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gauche f9064d8 003/119: Implement get-module and other Emacs functions |
Date: |
Sun, 1 Aug 2021 18:27:46 -0400 (EDT) |
branch: elpa/geiser-gauche
commit f9064d863a823d885f84194ccad495c5c05cc755
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>
Implement get-module and other Emacs functions
---
geiser-gauche.el | 57 ++++++++++++++++++++++++++++----------------------------
1 file changed, 29 insertions(+), 28 deletions(-)
diff --git a/geiser-gauche.el b/geiser-gauche.el
index ffbbc0b..850813f 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -1,4 +1,4 @@
-;;; geiser-gauche.el -- Chez Scheme's implementation of the geiser protocols
+;;; geiser-gauche.el -- Gauche Scheme's implementation of the geiser protocols
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the Modified BSD License. You should
@@ -26,22 +26,17 @@
;;; Customization:
(defgroup geiser-gauche nil
- "Customization for Geiser's Chez Scheme flavour."
+ "Customization for Geiser's Gauche Scheme flavour."
:group 'geiser)
(geiser-custom--defcustom geiser-gauche-binary
- "scheme"
- "Name to use to call the Chez Scheme executable when starting a REPL."
+ "gosh"
+ "Name to use to call the Gauche Scheme executable when starting a REPL."
:type '(choice string (repeat string))
:group 'geiser-gauche)
-(geiser-custom--defcustom geiser-gauche-init-file "~/.chez-geiser"
- "Initialization file with user code for the Chez REPL."
- :type 'string
- :group 'geiser-gauche)
-
-(geiser-custom--defcustom geiser-gauche-extra-command-line-parameters '()
- "Additional parameters to supply to the Chez binary."
+(geiser-custom--defcustom geiser-gauche-extra-command-line-parameters '("-i")
+ "Additional parameters to supply to the Gauche binary."
:type '(repeat string)
:group 'geiser-gauche)
@@ -54,13 +49,10 @@
geiser-gauche-binary))
(defun geiser-gauche--parameters ()
- "Return a list with all parameters needed to start Chez Scheme.
-This function uses `geiser-gauche-init-file' if it exists."
- (let ((init-file (and (stringp geiser-gauche-init-file)
- (expand-file-name geiser-gauche-init-file))))
- `(,@(and init-file (file-readable-p init-file) (list init-file))
- ,(expand-file-name "chez/geiser/geiser.ss" geiser-scheme-dir)
- ,@geiser-gauche-extra-command-line-parameters)))
+ "Return a list with all parameters needed to start Gauche Scheme."
+ `(,@geiser-gauche-extra-command-line-parameters
+ "-l" ,(expand-file-name "gauche/geiser.scm" geiser-scheme-dir)
+ ,@(and (listp geiser-gauche-binary) (cdr geiser-gauche-binary))))
(defconst geiser-gauche--prompt-regexp "> ")
@@ -86,9 +78,19 @@ This function uses `geiser-gauche-init-file' if it exists."
(let ((form (mapconcat 'identity args " ")))
(format "(geiser:%s %s)" proc form)))))
+(defconst geiser-gauche--module-re
+ "(define-module +\\(\\w+\\)")
+
(defun geiser-gauche--get-module (&optional module)
(cond ((null module)
- :f)
+ (save-excursion
+ (geiser-syntax--pop-to-top)
+ (message "%s" )
+ (if (or (re-search-backward geiser-gauche--module-re nil t)
+ (looking-at geiser-gauche--module-re)
+ (re-search-forward geiser-gauche--module-re nil t))
+ (geiser-gauche--get-module (match-string-no-properties 1))
+ :f)))
((listp module) module)
((stringp module)
(condition-case nil
@@ -105,9 +107,9 @@ This function uses `geiser-gauche-init-file' if it exists."
(defun geiser-gauche--import-command (module)
(format "(import %s)" module))
-(defun geiser-gauche--exit-command () "(exit 0)")
-;;
-;; ;;; REPL startup
+(defun geiser-gauche--exit-command () "(exit)")
+
+;;; REPL startup
(defconst geiser-gauche-minimum-version "9.4")
@@ -126,11 +128,11 @@ This function uses `geiser-gauche-init-file' if it
exists."
;;; Manual look up
-(defun guile--manual-look-up (id mod)
+(defun gauche--manual-look-up (id mod)
(let ((info-lookup-other-window-flag
- geiser-guile-manual-lookup-other-window-p))
- (info-lookup-symbol (symbol-name id) 'geiser-guile-mode))
- (when geiser-guile-manual-lookup-other-window-p
+ geiser-gauche-manual-lookup-other-window-p))
+ (info-lookup-symbol (symbol-name id) 'geiser-gauche-mode))
+ (when geiser-gauche-manual-lookup-other-window-p
(switch-to-buffer-other-window "*info*"))
(search-forward (format "%s" id) nil t))
@@ -159,7 +161,6 @@ This function uses `geiser-gauche-init-file' if it exists."
;; (case-sensitive geiser-gauche-case-sensitive-p)
)
-(geiser-impl--add-to-alist 'regexp "\\.ss$" 'chez t)
-(geiser-impl--add-to-alist 'regexp "\\.def$" 'chez t)
+(geiser-impl--add-to-alist 'regexp "\\.scm$" 'gauche t)
(provide 'geiser-gauche)
- [nongnu] elpa/geiser-gauche 432f570 001/119: Create README.md, (continued)
- [nongnu] elpa/geiser-gauche 432f570 001/119: Create README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche e70d9ed 019/119: Cleanup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 202336b 006/119: Add case-sensitivity variable, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 60c95ca 002/119: Add initial version of geiser.scm and geiser-gauche.el, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 6da3f02 011/119: Fix geiser:eval, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche b474b09 014/119: Don't filter completions based on context (for now), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 9dafd9f 079/119: License-related updates, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 04208f5 075/119: Cleanup Cask file, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 687713c 085/119: Update README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche f1ccc62 086/119: Update README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche f9064d8 003/119: Implement get-module and other Emacs functions,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gauche ca7629e 012/119: geieser-gauche fixes, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 4cb8586 007/119: Fix gauche prompt regexp, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 5876bc2 018/119: Deal with dotted signatures in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 3fee273 027/119: Get autodoc info from all modules, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 98c52e6 023/119: Deal with complex key arguments, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche c9d367e 024/119: Fix complex key argument autodocs, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 5c18e45 030/119: Finish autodoc and symbol signature lookup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 752a496 031/119: Add code source reference, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 2ef21b4 044/119: Remove a TODO comment, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 762cd22 035/119: Add guessing functions, Philip Kaludercic, 2021/08/01