Global-git-commit-mode loads term, vterm, eshell, dired eagerly

What happened?

global-git-commit-mode in doom-first-file-hook loads term, vterm, eshell, dired

What did you expect to happen?

Those 4 libraries shouldn’t be loaded so early.

Steps to reproduce

  1. From the CLI, emacs test.txt
  2. Check loaded libraries: M-: (-intersection '(term vterm dired eshell) features)

System information


Loading data dump...

I don’t really know the reason, the issue is indirectly caused by with-editor (a dependency of git-commit)'s code:

(eval-when-compile
  (progn (require 'dired nil t)
         (require 'eshell nil t)
         (require 'term nil t)
         (condition-case err
             (require 'vterm nil t)
           (error (message "Error(vterm): %S" err)))
         (require 'warnings nil t)))

The problem doesn’t appear when I test agains vanilla Doom (:term (vterm) enabled) or personal config (it’s runnable without installing Doom) with vterm installed, just only when Doom + my config, has anyone run to this before?

Edit: fixed from with-editor's commit 48996e3116dadee06c8c68b1a0fe6ad8fd5317e0, but I’m still not sure why it’s not always reproducible.

It depends on whether you’re loading with-editor.elc or with-editor.el. eval-when-compile blocks are replaced with their return value when compiled, so loading the *.elc won’t load term/vterm/dired/etc.


In any case, seems this issue is an upstream one, rather than a Doom issue, and has been resolved, so I’ll mark this post as a solution.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.