build-system: emacs: Use new function for autoloads generation

* guix/build/emacs-utils.scm (emacs-generate-autoloads): Use
'loaddefs-generate' to create autoloads instead of
'update-directory-autoloads' if we are using a new enough Emacs

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Morgan Smith 2022-08-10 13:37:09 -04:00 committed by Liliana Marie Prikler
parent 799f48771f
commit 58d0453aa7
No known key found for this signature in database
GPG Key ID: 442A84B8C70E2F87

@ -106,7 +106,14 @@ true, evaluate using dynamic scoping."
(let* ((file (string-append directory "/" name "-autoloads.el"))
(expr `(let ((backup-inhibited t)
(generated-autoload-file ,file))
(update-directory-autoloads ,directory))))
(cond
((require 'loaddefs-gen nil t)
;; Emacs >= 29
(loaddefs-generate ,directory ,file))
((fboundp 'make-directory-autoloads)
;; Emacs 28
(make-directory-autoloads ,directory ,file))
(t (update-directory-autoloads ,directory))))))
(emacs-batch-eval expr #:dynamic? #t)))
(define* (emacs-byte-compile-directory dir)