 (define-key geiser-repl-mode-map "\C-cm" 'geiser-repl--doc-module)
 (define-key geiser-repl-mode-map "\C-cl" 'geiser-load-file)
 
-(define-key geiser-repl-mode-map "\M-p" 'comint-previous-matching-input-from-input)
-(define-key geiser-repl-mode-map "\M-n" 'comint-next-matching-input-from-input)
+(define-key geiser-repl-mode-map "\M-p"
+  'comint-previous-matching-input-from-input)
+(define-key geiser-repl-mode-map "\M-n"
+  'comint-next-matching-input-from-input)
 (define-key geiser-repl-mode-map "\C-c\M-p" 'comint-previous-input)
 (define-key geiser-repl-mode-map "\C-c\M-n" 'comint-next-input)
 
-(define-key geiser-repl-mode-map (kbd "TAB") 'geiser-completion--complete-symbol)
-(define-key geiser-repl-mode-map (kbd "M-TAB") 'geiser-completion--complete-symbol)
-(define-key geiser-repl-mode-map (kbd "M-`") 'geiser-completion--complete-module)
-(define-key geiser-repl-mode-map (kbd "C-.") 'geiser-completion--complete-module)
+(define-key geiser-repl-mode-map (kbd "TAB")
+  'geiser-completion--complete-symbol)
+(define-key geiser-repl-mode-map (kbd "M-TAB")
+  'geiser-completion--complete-symbol)
+(define-key geiser-repl-mode-map (kbd "M-`")
+  'geiser-completion--complete-module)
+(define-key geiser-repl-mode-map (kbd "C-.")
+  'geiser-completion--complete-module)
 (define-key geiser-repl-mode-map "\M-." 'geiser-edit-symbol-at-point)
 (define-key geiser-repl-mode-map "\M-," 'geiser-edit-pop-edit-symbol-stack)
 

         (geiser-impl--method 'find-module geiser-impl--implementation)))
    (geiser-doc-module)))

(define-derived-mode geiser-repl-mode comint-mode "REPL"
  "Major mode for interacting with an inferior scheme repl process.
\\{geiser-repl-mode-map}"
  (set (make-local-variable 'mode-line-process) nil)
  (set (make-local-variable 'comint-use-prompt-regexp) t)
  (set (make-local-variable 'comint-prompt-read-only)
       geiser-repl-read-only-prompt-p)
  (set (make-local-variable 'beginning-of-defun-function)
       'geiser-repl--beginning-of-defun)
  (set-syntax-table scheme-mode-syntax-table)
  (setq geiser-eval--get-module-function 'geiser-repl--module-function)
  (when geiser-repl-autodoc-p (geiser-autodoc-mode 1))
  (setq geiser-autodoc--inhibit-function 'geiser-con--is-debugging)
  (geiser-company--setup geiser-repl-company-p)
  ;; enabling compilation-shell-minor-mode without the annoying highlighter
  (compilation-setup t))

(define-key geiser-repl-mode-map "\C-d" 'delete-char)

(define-key geiser-repl-mode-map "\C-ck" 'geiser-repl-nuke)
(define-key geiser-repl-mode-map "\C-c\C-k" 'geiser-repl-nuke)

  (when (= (point) (comint-bol)) (beginning-of-line)))

(defun geiser-repl--beginning-of-defun ()
  (save-restriction
    (when comint-last-prompt-overlay
      (narrow-to-region (overlay-end comint-last-prompt-overlay) (point)))
    (let ((beginning-of-defun-function nil))
      (beginning-of-defun))))

(defun geiser-repl--module-function (&optional ignore) :f)

