[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-gauche eae0506 082/119: Finish autoload related cha
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-gauche eae0506 082/119: Finish autoload related changes |
Date: |
Sun, 1 Aug 2021 18:28:01 -0400 (EDT) |
branch: elpa/geiser-gauche
commit eae050605b45874048ebeb49951bac292fcf3ec3
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>
Finish autoload related changes
---
geiser-gauche-setup.el | 33 ---------------------------------
geiser-gauche.el | 37 +++++++++++++++++++++++++++++--------
2 files changed, 29 insertions(+), 41 deletions(-)
diff --git a/geiser-gauche-setup.el b/geiser-gauche-setup.el
deleted file mode 100644
index 030ac46..0000000
--- a/geiser-gauche-setup.el
+++ /dev/null
@@ -1,33 +0,0 @@
-;;; geiser-gauche-setup.el --- Set up Gauche support for Geiser -*-
lexical-binding:t -*-
-
-;; Copyright (C) 2020 András Simonyi
-
-;; Author: András Simonyi <andras.simonyi@gmail.com>
-;; SPDX-License-Identifier: BSD-3-Clause
-
-;; This file is not part of GNU Emacs.
-
-;;; Commentary:
-
-;; Function to set up Gauche support in Geiser. It is in a separate file to
-;; avoid loading geiser-gauche in the setup phase.
-
-;;; Code:
-
-(require 'geiser-gauche)
-
-;;;###autoload
-(defun geiser-gauche-setup ()
- "Set up Geiser Gauche support.
-Add Gauche to the list of active Scheme implementations if the
-user didn't customize the list."
- (interactive)
- (eval-after-load 'geiser-impl
- ;; Add Gauche only if the list of active impls is the standard one.
- (when (equalp (cadar (get 'geiser-active-implementations 'standard-value))
- geiser-active-implementations)
- (add-to-list 'geiser-active-implementations 'gauche))))
-
-(provide 'geiser-gauche-setup)
-
-;;; geiser-gauche-setup.el ends here
diff --git a/geiser-gauche.el b/geiser-gauche.el
index 86596e6..aa9777b 100644
--- a/geiser-gauche.el
+++ b/geiser-gauche.el
@@ -26,6 +26,7 @@
(require 'geiser-custom)
(require 'geiser-eval)
(require 'geiser-log)
+(require 'geiser-impl)
(require 'geiser)
@@ -91,10 +92,10 @@
(defconst geiser-gauche--prompt-regexp "gosh\\(\\[[^(]+\\]\\)?> ")
-;;; Evaluation support:
+;;; Evaluation support
(defun geiser-gauche--geiser-procedure (proc &rest args)
- "String to send to the repl to execute geiser PROC with ARGS."
+ "String to send to the REPL to execute geiser PROC with ARGS."
(cl-case proc
;; Autodoc and symbol-location makes use of the {{cur-module}} cookie to
;; pass current module information
@@ -123,12 +124,15 @@
(let ((form (mapconcat 'identity args " ")))
(format "(eval '(geiser:%s %s) (find-module 'geiser))" proc form)))))
+
+;;; Module handling
+
(defconst geiser-gauche--module-re
"(define-module +\\([[:alnum:].-]+\\)"
"Regex for locating the module defined in a scheme source.")
(defun geiser-gauche--get-current-repl-module ()
- "Return the current repl module's name as a string."
+ "Return the current REPL module's name as a string."
(substring
(geiser-eval--send/result
'(list (list (quote result) (write-to-string (current-module)))))
@@ -145,7 +149,7 @@ form."
(looking-at geiser-gauche--module-re)
(re-search-forward geiser-gauche--module-re nil t))
(geiser-gauche--get-module (match-string-no-properties 1))
- ;; Return the repl module as fallback
+ ;; Return the REPL module as fallback
(geiser-gauche--get-module
(geiser-gauche--get-current-repl-module)))))
((symbolp module) module)
@@ -164,6 +168,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))
@@ -255,7 +260,7 @@ form."
(cadr (read (cadr (process-lines binary "-V")))))
(defun geiser-gauche--startup (_remote)
- "Initialize a Gauche repl."
+ "Initialize a Gauche REPL."
(let ((geiser-log-verbose-p t))
(compilation-setup t)
(geiser-eval--send/wait "(newline)")))
@@ -312,13 +317,13 @@ form."
(regexp-opt '("gauche" "gosh")))
(defun geiser-gauche--guess ()
- "Guess whether the current buffer edits Gauche code or repl."
+ "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:
+;;; Implementation definition
(define-geiser-implementation gauche
(unsupported-procedures '(callers callees generic-methods))
@@ -345,8 +350,24 @@ form."
(geiser-impl--add-to-alist 'regexp "\\.scm$" 'gauche t)
-(add-to-list 'geiser-active-implementations 'gauche)
+
+;;; Autoloads
+
+;;;###autoload
+(autoload 'run-gauche "geiser-gauche" "Start a Geiser Gauche Scheme REPL." t)
+
+;;;###autoload
+(autoload 'switch-to-gauche "geiser-gauche"
+ "Start a Geiser Gauche Scheme REPL, or switch to a running one." t)
+;;;###autoload
+(with-eval-after-load 'geiser-impl
+ ;; Add Gauche to the list of active implementations if not set manually.
+ (when (equal (cadar (get 'geiser-active-implementations 'standard-value))
+ geiser-active-implementations)
+ (add-to-list 'geiser-active-implementations 'gauche)))
+
+
(provide 'geiser-gauche)
;;; geiser-gauche.el ends here
- [nongnu] elpa/geiser-gauche 6110849 067/119: Add dash to module name regex, (continued)
- [nongnu] elpa/geiser-gauche 6110849 067/119: Add dash to module name regex, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 060b7ee 062/119: Finish symbol location, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 9ffc5bd 058/119: Add comments, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 3d540b3 061/119: Symbol location work, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 2d2d29c 059/119: Reorder to silence an elisp compiler warning, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 5f4d1b5 070/119: Comment cleanup, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 362f1d1 071/119: Add LICENSE, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 9a26b8f 072/119: Aesthetic changes toward MELPA, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 83c9949 069/119: Minor improvement, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 93a7c9d 073/119: Add Cask file, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche eae0506 082/119: Finish autoload related changes,
Philip Kaludercic <=
- [nongnu] elpa/geiser-gauche fb927ed 084/119: Update README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche bdaeb16 097/119: Fix comletion bug, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche b8a5c0d 091/119: Minor README update, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 45ee16c 100/119: Minor README improvement, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche abd3353 101/119: Add TOC to README, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche dfc3090 106/119: Correctly detect version with Gauche 0.9.6, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 8e737d2 110/119: Improve completion, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 5a2f9c6 118/119: Update README, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 2d3992e 117/119: Update README, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-gauche 6b79b43 036/119: Cleanup, Philip Kaludercic, 2021/08/01