emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: 2a529ee57 org-element: Autoload org-element-use-cache
Date: Tue, 13 Dec 2022 22:23:44 -0500	[thread overview]
Message-ID: <87lenabrcv.fsf@kyleam.com> (raw)
In-Reply-To: <87pmcnela2.fsf@localhost>

Ihor Radchenko writes:

> You wrote in the commit message that autoload.el is deprecated in Emacs
> 29. Do we need to do anything about it in Org make system?

Yes, though I don't consider it urgent given the deprecation hasn't even
made it into a release.  I was planning on doing something like below
(only lightly tested at this point).  And then way down the road we can
drop the compatibility kludge.


diff --git a/mk/org-fixup.el b/mk/org-fixup.el
index 5989875a8..60c39c684 100644
--- a/mk/org-fixup.el
+++ b/mk/org-fixup.el
@@ -24,7 +24,6 @@
 ;;
 ;;; Commentary:
 
-(require 'autoload)
 (require 'org-compat "org-compat.el")
 
 (defun org-make-manual ()
@@ -86,18 +85,22 @@ (defun org-make-org-loaddefs ()
 be used by foreign build systems or installers to produce this
 file in the installation directory of Org mode.  Org will not
 work correctly if this file is not up-to-date."
-  (with-temp-buffer
-    (set-visited-file-name "org-loaddefs.el")
-    (insert ";;; org-loaddefs.el --- autogenerated file, do not edit\n;;\n;;; Code:\n")
-    (let ((files (directory-files default-directory
-				  nil "^\\(org\\|ob\\|ox\\|ol\\|oc\\)\\(-.*\\)?\\.el$")))
-      (mapc (lambda (f) (generate-file-autoloads f)) files))
-    (insert "\f\n(provide 'org-loaddefs)\n")
-    (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))))
+  (let ((outfile "org-loaddefs.el"))
+    (if (fboundp 'loaddefs-generate)    ; Emacs >= 29
+        (loaddefs-generate default-directory (expand-file-name outfile))
+      (require 'autoload)
+      (with-temp-buffer
+        (set-visited-file-name outfile)
+        (insert ";;; org-loaddefs.el --- autogenerated file, do not edit\n;;\n;;; Code:\n")
+        (let ((files (directory-files default-directory
+                                      nil "^\\(org\\|ob\\|ox\\|ol\\|oc\\)\\(-.*\\)?\\.el$")))
+          (mapc (lambda (f) (generate-file-autoloads f)) files))
+        (insert "\f\n(provide 'org-loaddefs)\n")
+        (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)
   "Make the files org-loaddefs.el and org-version.el in the install directory.


  reply	other threads:[~2022-12-14  3:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13  8:54 2a529ee57 org-element: Autoload org-element-use-cache Ihor Radchenko
2022-12-14  3:23 ` Kyle Meyer [this message]
2022-12-14 10:04   ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lenabrcv.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).