[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gauche 1e09ad7 092/119: Finish elisp stylistic impr
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gauche 1e09ad7 092/119: Finish elisp stylistic improvements |
Date: |
Sun, 1 Aug 2021 18:28:03 -0400 (EDT) |
branch: elpa/geiser-gauche
commit 1e09ad7401e2e73d5216633338f07eacdd1a6201
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>
Finish elisp stylistic improvements
---
geiser-gauche.el | 87 ++++++++++++++++++++++++--------------------------------
1 file changed, 37 insertions(+), 50 deletions(-)
diff --git a/geiser-gauche.el b/geiser-gauche.el
index db92fea..b0626b3 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -14,7 +14,7 @@
;;; Commentary:
-;; geiser-gauche adds Gauche scheme support to the `geiser' package
+;; geiser-gauche adds Gauche Scheme support to the `geiser' package
;;; Code:
@@ -29,7 +29,6 @@
(require 'geiser-impl)
(require 'geiser)
-
;;; Customization
(defgroup geiser-gauche nil
@@ -68,14 +67,24 @@
:type 'boolean
:group 'geiser-gauche)
-
;;; Utils
(defconst geiser-gauche--load-dir (f-dirname load-file-name)
"The dir from geicher-gauche was loaded.")
-
-;;; REPL support:
+(defun geiser-gauche--symbol-begin (_module)
+ "Return the beginning position of the symbol at point."
+ (max (save-excursion (beginning-of-line) (point))
+ (save-excursion (skip-syntax-backward "^(>") (1- (point)))))
+
+;;; REPL
+
+(defconst geiser-gauche--prompt-regexp "gosh\\(\\[[^(]+\\]\\)?> ")
+
+(defconst geiser-gauche--minimum-version "0.9.7")
+
+(defconst geiser-gauche--exit-command
+ "(exit)")
(defun geiser-gauche--binary ()
"Return the runnable Gauche binary name without path."
@@ -89,10 +98,28 @@
"-l" ,(expand-file-name "geiser-gauche.scm" geiser-gauche--load-dir)
,@(and (listp geiser-gauche-binary) (cdr geiser-gauche-binary))))
-(defconst geiser-gauche--prompt-regexp "gosh\\(\\[[^(]+\\]\\)?> ")
+(defun geiser-gauche--version (binary)
+ "Return the version of a Gauche BINARY."
+ (cadr (read (cadr (process-lines binary "-V")))))
+
+(defun geiser-gauche--startup (_remote)
+ "Initialize a Gauche REPL."
+ (let ((geiser-log-verbose-p t))
+ (compilation-setup t)
+ (geiser-eval--send/wait "(newline)")))
+
+;;; Guess whether buffer is Gauche
+
+(defconst geiser-gauche--guess-re
+ (regexp-opt '("gauche" "gosh")))
+
+(defun geiser-gauche--guess ()
+ "Guess whether the current buffer edits Gauche code or REPL."
+ (save-excursion
+ (goto-char (point-min))
+ (re-search-forward geiser-gauche--guess-re nil t)))
-
-;;; Evaluation support
+;;; Evaluation
(defun geiser-gauche--geiser-procedure (proc &rest args)
"String to send to the REPL to execute geiser PROC with ARGS."
@@ -124,7 +151,6 @@
(let ((form (mapconcat 'identity args " ")))
(format "(eval '(geiser:%s %s) (find-module 'geiser))" proc form)))))
-
;;; Module handling
(defconst geiser-gauche--module-re
@@ -168,14 +194,7 @@ form."
"Return a scheme expression string to import MODULE."
(format "(import %s)" module))
-
-(defun geiser-gauche--symbol-begin (_module)
- "Return the beginning position of the symbol at point."
- (max (save-excursion (beginning-of-line) (point))
- (save-excursion (skip-syntax-backward "^(>") (1- (point)))))
-
-(defconst geiser-gauche--exit-command
- "(exit)")
+;;; Keywords and syntax
(defconst geiser-gauche--binding-forms
'("and-let" "and-let1" "let1" "if-let1" "rlet1" "receive" "fluid-let"
"let-values"
@@ -250,22 +269,6 @@ form."
(case-lambda: 0)
(let1 1))
-
-;;; REPL startup
-
-(defconst geiser-gauche--minimum-version "0.9.7")
-
-(defun geiser-gauche--version (binary)
- "Return the version of a Gauche BINARY."
- (cadr (read (cadr (process-lines binary "-V")))))
-
-(defun geiser-gauche--startup (_remote)
- "Initialize a Gauche REPL."
- (let ((geiser-log-verbose-p t))
- (compilation-setup t)
- (geiser-eval--send/wait "(newline)")))
-
-
;;; Error display
(defun geiser-gauche--display-error (_module key msg)
@@ -280,8 +283,7 @@ form."
(insert msg))
(if (and msg (string-match "\\(.+\\)$" msg)) (match-string 1 msg) key))
-
-;;; Manual look up -- code adapted from the Guile implementation
+;;; Manual lookup -- code adapted from the Guile implementation
(defun geiser-gauche--info-spec (&optional nodes)
"Return an info docspec list for NODES."
@@ -310,19 +312,6 @@ form."
(switch-to-buffer-other-window "*info*"))
(search-forward (format "%s" id) nil t))
-
-;;; Guess whether buffer is Gauche
-
-(defconst geiser-gauche--guess-re
- (regexp-opt '("gauche" "gosh")))
-
-(defun geiser-gauche--guess ()
- "Guess whether the current buffer edits Gauche code or REPL."
- (save-excursion
- (goto-char (point-min))
- (re-search-forward geiser-gauche--guess-re nil t)))
-
-
;;; Implementation definition
(define-geiser-implementation gauche
@@ -350,7 +339,6 @@ form."
(geiser-impl--add-to-alist 'regexp "\\.scm$" 'gauche t)
-
;;; Autoloads
;;;###autoload
@@ -360,7 +348,6 @@ form."
(autoload 'switch-to-gauche "geiser-gauche"
"Start a Geiser Gauche Scheme REPL, or switch to a running one." t)
-
(provide 'geiser-gauche)
;;; geiser-gauche.el ends here
- [nongnu] elpa/geiser-gauche 4195803 028/119: Prefer longest require arg list in autodoc, (continued)
- [nongnu] elpa/geiser-gauche 4195803 028/119: Prefer longest require arg list in autodoc, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche d5d68fd 039/119: Don't import the geiser module at startup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 0fac12f 048/119: Improve module documentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche a0eee47 068/119: Correctly detect current module in the repl, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 4890817 063/119: Add let1 and case-lambda to the syntax rules, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche d71c212 074/119: Add compile to the require list, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 34490de 078/119: Small corrections, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche aeeb8b3 080/119: Minor fix, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche dd68fc7 087/119: Update README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 6dfc178 090/119: Add experimental status warning, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 1e09ad7 092/119: Finish elisp stylistic improvements,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gauche 9e7ed54 103/119: Bump version, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche ea011ac 111/119: Remove trailing whitespaces, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 19d6d41 112/119: Comment update, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 66e5143 119/119: Correct a comment typo., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 0e415bf 114/119: Sharp-quote identity function references everywhere, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 2217232 116/119: Update README, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 9623869 083/119: WIP README update, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 33e3242 089/119: Add Gauche sentence to credits, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 56fcf56 094/119: Reorder the Scheme functions, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 74ae3f8 095/119: Add (back) page breaks, Philip Kaludercic, 2021/08/01