geiser-repl.el is loaded twice (circular dependency?)
Hello, I see that geiser modules require many other geiser modules. And
I have a feeling that there are circular dependencies somewhere (it's
just a guess). At least I noticed that geiser-repl
is loaded twice
when geiser-mode
is required. I checked it by adding:
(message "---- 'geiser-repl' is loaded ----")
to the very end of "geiser-repl.el". Then I ran emacs, evaluated
(require 'geiser-mode)
and I saw this string twice in the Messages
buffer.
This may lead to unpleasant consequences for users. For example, if you
put the following into your .emacs
:
(with-eval-after-load 'geiser-repl
(define-key geiser-repl-mode-map (kbd "C-c C-d") 'geiser-repl-exit))
and after starting emacs you open a scheme file, you will get the following error:
Key sequence C-c C-d m starts with non-prefix key C-c C-d
This happens because when geiser-repl
is loaded the first time C-c C-d
key sequence is bound successfully, but then geiser-repl
is
loaded again, and it tries to bind several C-c C-d ...
documentation
keys but it's not possible anymore because C-c C-d
is already bound.
To investigate where circularity may happen, I tried the following code:
(defun require-message (feature &rest _)
(message "Requiring %s" feature))
(advice-add 'require :before #'require-message)
But after evaluating (require 'geiser-mode)
(in a freshly started
Emacs) I saw so many "Requiring geiser-…" messages, that... I decided to
open this issue :-)