Ihor Radchenko <[email protected]> writes:

> Morgan Smith <[email protected]> writes:
>
>> Could you please confirm it is that patch which is the issue by
>> reverting it and trying again?
>
> Yes, reverting the patch helped.
>
>> This actually sounds a lot like a bug in core Emacs which I recently had
>> to work around in guix:
>
> I indeed can only reproduce on master.
> With Emacs 29 and Emacs 30, I do not see the problem.

Ok so yes I caused this but also yes I'm pretty sure this is an upstream
Emacs issue.  Ugh.  Looks like the error goes away if we eagerly load
"cl-macs".

I'm able to reproduce this on Emacs 31.1 so I think we're going to need
a temporary workaround and to alert upstream.

I tried adding "(require 'cl-macs)" to the top of all files that use
"cl-defun" but that didn't seem to fix it.  This is probably because
`loaddefs-generate--make-autoload' messes with the load-path so we are
unable to load it during autoload generation.


#+begin_src sh :results output :wrap example
git clean -xfd
emacs -Q --batch --eval='(loaddefs-generate "./lisp/" 
"./lisp/org-loaddefs.el")' 2>&1
#+end_src

#+RESULTS:
#+begin_example
Removing lisp/org-loaddefs.el
  INFO     Scraping 128 files for loaddefs...
loaddefs-gen: loading file org-element (for cl-defun)
Loading /home/pancake/src/emacs/org-mode/lisp/org-element.el (source)...
WARNING: org-loaddefs.el file could not be loaded from where org.el is loaded - 
(file-missing "Cannot open load file" "No such file or directory" 
"/home/pancake/src/emacs/org-mode/lisp/org-loaddefs")
You need to run "make" or "make autoloads" from Org lisp directory
  INFO     Scraping 128 files for loaddefs...67%
  INFO     Scraping 128 files for loaddefs...77%
  INFO     Scraping 128 files for loaddefs...87%
  INFO     Scraping 128 files for loaddefs...97%
  INFO     Scraping 128 files for loaddefs...100%
  INFO     Scraping 128 files for loaddefs...done
  GEN      org-loaddefs.el
#+end_example

#+begin_src sh :results output :wrap example
git clean -xfd
emacs -Q --batch -l cl-macs --eval='(loaddefs-generate "./lisp/" 
"./lisp/org-loaddefs.el")' 2>&1
#+end_src

#+RESULTS:
#+begin_example
Removing lisp/org-loaddefs.el
  INFO     Scraping 128 files for loaddefs...
  INFO     Scraping 128 files for loaddefs...92%
  INFO     Scraping 128 files for loaddefs...done
  GEN      org-loaddefs.el
#+end_example


Reply via email to