[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gauche bdd8976 017/119: First version with working
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gauche bdd8976 017/119: First version with working autocomplete |
Date: |
Sun, 1 Aug 2021 18:27:49 -0400 (EDT) |
branch: elpa/geiser-gauche
commit bdd897623e904b47c73bdf4e3158642ce4afdc29
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>
First version with working autocomplete
---
geiser.scm | 39 ++++++++++++++++++++++++++++++++++-----
1 file changed, 34 insertions(+), 5 deletions(-)
diff --git a/geiser.scm b/geiser.scm
index 780b2fb..879283e 100644
--- a/geiser.scm
+++ b/geiser.scm
@@ -42,11 +42,6 @@
(write `((result ,(write-to-string result))
(output . ,(get-output-string output))))))
-
-(define (geiser:autodoc ids . rest)
- (map (cut ~ <> 'info)
- ids))
-
(define (geiser:load-file filename)
(load filename))
@@ -79,8 +74,42 @@
(map (^x (symbol->string (module-name x)))
(all-modules))))
+;;; Autodoc
+
+(define (geiser:autodoc ids . rest)
+ (map (cut gauche-info <>)
+ ids))
+
+(define (gauche-info id)
+ (let ((module (find-module 'user)))
+ (if (global-variable-bound? 'user id)
+ (let1 obj (global-variable-ref (find-module 'user) id)
+ (if (is-a? obj <procedure>)
+ (process-info (~ obj 'info))
+ `(,id)))
+ `(,id))))
+
+(define (process-info info)
+ (let* ((required '("required"))
+ (optional '("optional"))
+ (key '("key"))
+ (section :required))
+ (dolist (x (cdr info))
+ (case x
+ ((:optional :key) (set! section x))
+ ((:rest))
+ (else (case section
+ ((:optional) (push! optional x))
+ ((:key) (push! key x))
+ (else (push! required x))))))
+ `(,(car info) ("args"
+ ,(map (cut reverse <>)
+ (list required optional key)))
+ ("module" user))))
+
;; Further
;; TODO We add the load-path at the end. Is this correct?
(define-macro (geiser:add-to-load-path dir)
`(add-load-path ,dir :after))
+
- [nongnu] elpa/geiser-gauche 0d2827c 093/119: Minor aesthetic improvement, (continued)
- [nongnu] elpa/geiser-gauche 0d2827c 093/119: Minor aesthetic improvement, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 13e4030 015/119: Implement adding to load-path, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche d2ffff8 104/119: Update README, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 26e3c14 105/119: Change minimum required Gauche version to 9.9, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 8908ad8 108/119: Lower require minimal version to 0.9.6, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche b10594b 042/119: Fixes and logging, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 30f4558 052/119: Fix no-values, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 429ad45 055/119: Add special handling for compile-file in the elisp eval proc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 72f5107 054/119: Minor fixes, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche b702719 057/119: Simplify elisp-side eval, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche bdd8976 017/119: First version with working autocomplete,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gauche 94546ce 016/119: Add ^_ to the keyword lists, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 32b94a9 008/119: Remove diagnostic message, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 0de6385 025/119: Finish key argument handling in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche dc40919 026/119: Correct a comment, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 652927a 041/119: Pass the module as a last argument to geiser: functions, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 698a685 038/119: Fix eval and compile, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 8adaf75 037/119: Improvements, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 5d8264b 033/119: Add (commented out) debugging logging of commands in *scratch*, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche a90a648 032/119: Implement module location, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 558a52e 034/119: Fix module-re, Philip Kaludercic, 2021/08/01