Re: user-lisp-directory: can sibling files `require` each other? (byte-compile error)

Michael Heerdegen via Users list for the GNU Emacs text editor <[email protected]> Thu, 25 Jun 2026 16:29:14 +0200
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Antonio Romano <[email protected]> writes:

> It has the default value. It is not set anywhere in my personal
> config.

Ok.  Then, create a bug report, please!

I think the following happens.  Look at the code of `prepare-user-lisp'
where this compilation is performed:

#+begin_src emacs-lisp
    (dolist (file (directory-files-recursively dir "" t pred t))
      (cond
       ((and (file-regular-p file) (string-suffix-p ".el" file))
        (unless just-activate
          (with-demoted-errors "Error while compiling: %S"
            (byte-recompile-file file force 0)
            (when (native-comp-available-p)
              (native-compile-async file)))))
       ((and (file-directory-p file)
             (not (string-match-p ignored (file-name-nondirectory file))))
        (add-to-list 'load-path (directory-file-name file))
        (push file dirs))))
#+end_src

while

| (directory-files-recursively dir "" t pred t)
| --> ("/home/micha/.emacs.d/user-lisp/test/test.el"
|      "/home/micha/.emacs.d/user-lisp/test/test2.el"
|      "/home/micha/.emacs.d/user-lisp/test")

for me.  This means that the files will be compiled before their
directory is added to `load-path'.  I think this is the problem.

I don't think this is intended, looks like an oversight.  So please
report it.

Thank you very much.


Michael.