;;; -*- lexical-binding: t; -*-

(require 'syd/base)
(require 'syd/handle)
(require 'syd/popups)
(require 'syd/leader)

(use-package geiser
  :config
  (add-hook 'scheme-mode-hook #'syd-lisp-mode)
  (defun syd-scheme-eval-region (beg end)
    (geiser-eval-region beg end))
  (defun syd-scheme-doc ()
    (interactive)
    (geiser-doc-symbol-at-point)
    (geiser-doc--buffer))
  (syd-handle '(scheme-mode)
    :docs #'syd-scheme-doc
    :eval-region #'syd-scheme-eval-region
    :load-buffer #'geiser-eval-buffer)
  (syd-push
   shackle-rules
   `("*Geiser Documentation*" ,@syd-help-popup-options)))

(use-package geiser-guile)

(provide 'syd/scheme)
