<commit_before>;;; lang/scheme/config.el -*- lexical-binding: t; -*-

(add-hook 'scheme-mode-hook #'rainbow-delimiters-mode)

(def-package! geiser
  :mode ("\\.scm\\'" . scheme-mode)
  :mode ("\\.ss\\'"  . scheme-mode)
  :commands (geiser)
  :init
  (setq geiser-active-implementations '(guile chicken mit chibi chez))
  (set-repl-handler! 'scheme-mode '+scheme/repl)
  (set-eval-handler! 'scheme-mode #'geiser-eval-region)
  (set-lookup-handlers! 'scheme-mode
    :definition #'geiser-edit-symbol-at-point
    :documentation #'geiser-doc-symbol-at-point)
  :config
  (map! (:localleader
          (:map scheme-mode-map
            "'" #'geiser-mode-switch-to-repl
            "s" #'geiser-set-scheme

            (:prefix ("e" . "eval")
              "b" #'geiser-eval-buffer
              "B" #'geiser-eval-buffer-and-go
              "e" #'geiser-eval-definition
              "E" #'geiser-eval-definition-and-go
              "r" #'geiser-eval-region
              "R" #'geiser-eval-region-and-go)

            (:prefix ("h" . "help")
              "d" 'geiser-autodoc)
              ;; TODO add more help keybindings

            (:prefix ("r" . "repl")
              "b" #'geiser-switch-to-repl
              "q" #'geiser-repl-exit
              "r" #'geiser-restart-repl
              "R" #'geiser-reload
              "c" #'geiser-repl-clear-buffer)))))<commit_msg>lang/scheme: general refactor<commit_after>;;; lang/scheme/config.el -*- lexical-binding: t; -*-

;;;###package scheme
(add-hook 'scheme-mode-hook #'rainbow-delimiters-mode)


(use-package! geiser
  :defer t
  :init
  (setq geiser-active-implementations '(guile chicken mit chibi chez))
  (unless (featurep! :lang racket)
    (push 'racket geiser-active-implementations))
  (after! scheme  ; built-in
    (set-repl-handler! 'scheme-mode '+scheme/repl)
    (set-eval-handler! 'scheme-mode #'geiser-eval-region)
    (set-lookup-handlers! 'scheme-mode
      :definition #'geiser-edit-symbol-at-point
      :documentation #'geiser-doc-symbol-at-point))
  :config
  (map! :localleader
        :map scheme-mode-map
        "'" #'geiser-mode-switch-to-repl
        "s" #'geiser-set-scheme

        (:prefix ("e" . "eval")
          "b" #'geiser-eval-buffer
          "B" #'geiser-eval-buffer-and-go
          "e" #'geiser-eval-definition
          "E" #'geiser-eval-definition-and-go
          "r" #'geiser-eval-region
          "R" #'geiser-eval-region-and-go)

        (:prefix ("h" . "help")
          "d" 'geiser-autodoc)
        ;; TODO add more help keybindings

        (:prefix ("r" . "repl")
          "b" #'geiser-switch-to-repl
          "q" #'geiser-repl-exit
          "r" #'geiser-restart-repl
          "R" #'geiser-reload
          "c" #'geiser-repl-clear-buffer)))
{'fraction_non_alphanumeric': 0.17692027666545324, 'fraction_numerical': 0.0, 'mean_word_length': 2.147766323024055, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7562847', 'n_tokens_mistral': 1016, 'n_tokens_neox': 989, 'n_words': 173}