From dcded86fca731969fece47d57ce90d90e0fe701a Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 5 Jan 2025 15:30:41 +0000 Subject: Revert "Define autoloads how that is normally done" This reverts commit 67f727855895050aca3bcf37066e804dc8f307de. While the rationale is sound, it prevents simpler uses of geiser.el to run the package without having to install it. Fixes #70 --- elisp/geiser-impl.el | 6 +++--- elisp/geiser-mode.el | 6 ------ elisp/geiser-reload.el | 1 - elisp/geiser-repl.el | 5 ----- elisp/geiser.el | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 15 deletions(-) diff --git a/elisp/geiser-impl.el b/elisp/geiser-impl.el index e82c050..f95034a 100644 --- a/elisp/geiser-impl.el +++ b/elisp/geiser-impl.el @@ -143,9 +143,9 @@ in order to determine its scheme flavour." (push (cons impl file) geiser-impl--load-files))) ;;;###autoload -(progn ; Copy the whole definition to the autoloads file. - (defun geiser-activate-implementation (impl) - (add-to-list 'geiser-active-implementations impl))) +(progn ;Copy the whole def to the autoloads file. +(defun geiser-activate-implementation (impl) + (add-to-list 'geiser-active-implementations impl))) (defsubst geiser-deactivate-implementation (impl) (setq geiser-active-implementations diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index d5bfbfb..c8a9e0d 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -367,7 +367,6 @@ With prefix, try to enter the current buffer's module." (or geiser-mode-string (format " %s" (or (geiser-impl--impl-str) "G")))) -;;;###autoload (define-minor-mode geiser-mode "Toggle Geiser's mode. @@ -396,7 +395,6 @@ interacting with the Geiser REPL is at your disposal. (not (geiser-repl--connection*))) (save-window-excursion (geiser geiser-impl--implementation)))) -;;;###autoload (defun turn-on-geiser-mode () "Enable `geiser-mode' (in a Scheme buffer)." (interactive) @@ -407,14 +405,10 @@ interacting with the Geiser REPL is at your disposal. (interactive) (geiser-mode -1)) -;;;###autoload (defun geiser-mode--maybe-activate () (when (and geiser-mode-auto-p (eq major-mode 'scheme-mode)) (turn-on-geiser-mode))) -;;;###autoload -(add-hook 'scheme-mode-hook 'geiser-mode--maybe-activate) - ;;; Reload support: diff --git a/elisp/geiser-reload.el b/elisp/geiser-reload.el index e3adbdc..25560c6 100644 --- a/elisp/geiser-reload.el +++ b/elisp/geiser-reload.el @@ -47,7 +47,6 @@ geiser )) -;;;###autoload (defun geiser-unload () "Unload all Geiser modules." (interactive) diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 2cd7729..b8df566 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -1107,24 +1107,20 @@ buffer." ;;; User commands -;;;###autoload (define-obsolete-function-alias 'run-geiser 'geiser "Geiser 0.26") -;;;###autoload (defun geiser (impl) "Start a new Geiser REPL." (interactive (list (geiser-repl--get-impl "Start Geiser for scheme implementation: "))) (geiser-repl--start-repl impl nil)) -;;;###autoload (defun geiser-connect (impl &optional host port) "Start a new Geiser REPL connected to a remote Scheme process." (interactive (list (geiser-repl--get-impl "Connect to Scheme implementation: "))) (geiser-repl--start-repl impl (geiser-repl--read-address host port))) -;;;###autoload (defun geiser-connect-local (impl socket) "Start a new Geiser REPL connected to a remote Scheme process over a Unix-domain socket." @@ -1154,7 +1150,6 @@ over a Unix-domain socket." (define-obsolete-function-alias 'switch-to-geiser 'geiser-repl-switch "0.26") -;;;###autoload (defun geiser-repl-switch (&optional ask impl buffer) "Switch to running Geiser REPL. diff --git a/elisp/geiser.el b/elisp/geiser.el index 6576ac4..a7aabb9 100644 --- a/elisp/geiser.el +++ b/elisp/geiser.el @@ -51,12 +51,53 @@ ;;; Code: +;;; Locations: ;;;###autoload (defconst geiser-elisp-dir (file-name-directory (or load-file-name buffer-file-name)) "Directory containing Geiser's Elisp files.") + +;;; Autoloads: + +;;;###autoload +(autoload 'geiser-unload "geiser-reload" "Unload all Geiser code." t) + +;;;###autoload +(autoload 'geiser-reload "geiser-reload" "Reload Geiser code." t) + +;;;###autoload +(autoload 'geiser "geiser-repl" "Start a Geiser REPL." t) + +;;;###autoload +(autoload 'run-geiser "geiser-repl" "Start a Geiser REPL." t) + +;;;###autoload +(autoload 'geiser-connect "geiser-repl" + "Start a Geiser REPL connected to a remote server." t) + +;;;###autoload +(autoload 'geiser-connect-local "geiser-repl" + "Start a Geiser REPL connected to a remote server over a Unix-domain socket." + t) + +;;;###autoload +(autoload 'geiser-repl-switch "geiser-repl" + "Switch to a running one Geiser REPL." t) + +;;;###autoload +(autoload 'geiser-mode "geiser-mode" + "Minor mode adding Geiser REPL interaction to Scheme buffers." t) + +;;;###autoload +(autoload 'turn-on-geiser-mode "geiser-mode" + "Enable Geiser's mode (useful in Scheme buffers)." t) + +;;;###autoload +(autoload 'turn-off-geiser-mode "geiser-mode" + "Disable Geiser's mode (useful in Scheme buffers)." t) + (autoload 'geiser-activate-implementation "geiser-impl" "Register the given implementation as active.") @@ -79,5 +120,14 @@ geiser-implementation geiser-xref)) + +;;; Setup: + +;;;###autoload +(autoload 'geiser-mode--maybe-activate "geiser-mode") + +;;;###autoload +(add-hook 'scheme-mode-hook #'geiser-mode--maybe-activate) + (provide 'geiser) ;;; geiser.el ends here -- cgit v1.2.3