mk/org-fixup.el: Adjust for Emacs 29 autoload.el deprecation

* mk/org-fixup.el (org-make-org-loaddefs): Generate org-loaddefs.el
with loaddefs-generate if available.

Link: https://list.orgmode.org/87lenabrcv.fsf@kyleam.com
This commit is contained in:
Kyle Meyer 2023-05-21 17:06:59 -04:00
parent 6d9f3af774
commit fa058f6d97
1 changed files with 16 additions and 13 deletions

View File

@ -24,7 +24,6 @@
;; ;;
;;; Commentary: ;;; Commentary:
(require 'autoload)
(require 'org-compat "org-compat.el") (require 'org-compat "org-compat.el")
(defun org-make-manual () (defun org-make-manual ()
@ -86,18 +85,22 @@ This function is internally used by the build system and should
be used by foreign build systems or installers to produce this be used by foreign build systems or installers to produce this
file in the installation directory of Org mode. Org will not file in the installation directory of Org mode. Org will not
work correctly if this file is not up-to-date." work correctly if this file is not up-to-date."
(with-temp-buffer (let ((outfile "org-loaddefs.el"))
(set-visited-file-name "org-loaddefs.el") (if (fboundp 'loaddefs-generate) ; FIXME: Emacs >= 29
(insert ";;; org-loaddefs.el --- autogenerated file, do not edit\n;;\n;;; Code:\n") (loaddefs-generate default-directory (expand-file-name outfile))
(let ((files (directory-files default-directory (require 'autoload)
nil "^\\(org\\|ob\\|ox\\|ol\\|oc\\)\\(-.*\\)?\\.el$"))) (with-temp-buffer
(mapc (lambda (f) (generate-file-autoloads f)) files)) (set-visited-file-name outfile)
(insert "\f\n(provide 'org-loaddefs)\n") (insert ";;; org-loaddefs.el --- autogenerated file, do not edit\n;;\n;;; Code:\n")
(insert "\f\n;; Local Variables:\n;; version-control: never\n") (let ((files (directory-files default-directory
(insert ";; no-byte-compile: t\n;; no-update-autoloads: t\n") nil "^\\(org\\|ob\\|ox\\|ol\\|oc\\)\\(-.*\\)?\\.el$")))
(insert ";; coding: utf-8\n;; End:\n;;; org-loaddefs.el ends here\n") (mapc (lambda (f) (generate-file-autoloads f)) files))
(let ((inhibit-read-only t)) (insert "\f\n(provide 'org-loaddefs)\n")
(save-buffer)))) (insert "\f\n;; Local Variables:\n;; version-control: never\n")
(insert ";; no-byte-compile: t\n;; no-update-autoloads: t\n")
(insert ";; coding: utf-8\n;; End:\n;;; org-loaddefs.el ends here\n")
(let ((inhibit-read-only t))
(save-buffer))))))
(defun org-make-autoloads (&optional compile force) (defun org-make-autoloads (&optional compile force)
"Make the files org-loaddefs.el and org-version.el in the install directory. "Make the files org-loaddefs.el and org-version.el in the install directory.