Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: contovob@tcd.ie, 63260@debbugs.gnu.org, rpluim@gmail.com >> Date: Sun, 07 May 2023 13:12:47 +0000 >> >> One hack might just be to check if `loaddefs-generate' has generated >> anything at all or not, and if that is not the case to do so manually in >> package.el. The reason this doesn't seem nice, is that we'd have to >> make the fact that `loaddefs-generate' does not generate a OUTPUT-FILE >> if there is no file with autoloads explicit, and finding a justification >> for that is difficult. Alternatively, this could be done inside of >> `loaddefs-generate'? Something like > > Assuming it solves the issue and doesn't break anything, the latter > sounds good to me, better than the alternatives. > >> + ;; HACK: If no file with autoloads were found, but EXTRA-DATA was >> + ;; passed, we still want to generate a file. > > The comment says "EXTRA-DATA was passed", but this added snipped will > also run if EXTRA-DATA was NOT passed, but the OUTPUT-FILE doesn't > exist, right? Right, the code was not tested as I was in a hurry. I've changed it to ;; HACK: If no file with autoloads were found, but EXTRA-DATA was ;; passed, we still want to generate a file. (when (and extra-data (not (file-exists-p output-file))) and this file is generated when installing the SICP package: --8<---------------cut here---------------start------------->8--- ;;; sicp-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- ;; Generated by the `loaddefs-generate' function. ;; This file is part of GNU Emacs. ;;; Code: (add-to-list 'load-path (or (and load-file-name (file-name-directory load-file-name)) (car load-path))) ;;; End of scraped data (provide 'sicp-autoloads) ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t ;; no-native-compile: t ;; coding: utf-8-emacs-unix ;; End: ;;; sicp-autoloads.el ends here --8<---------------cut here---------------end--------------->8--- and this does not break anything when installing packages. > And I would explain in the comment the real-life situations where this > is needed, and why, rather than just explaining in English what the > code does. You are right. How does this patch look like: