guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/10: build-system: emacs: Use new function for autoloads generation


From: guix-commits
Subject: 08/10: build-system: emacs: Use new function for autoloads generation
Date: Sun, 11 Sep 2022 09:48:18 -0400 (EDT)

lilyp pushed a commit to branch master
in repository guix.

commit 58d0453aa7772def4de8e6aee38212a29aa84978
Author: Morgan Smith <Morgan.J.Smith@outlook.com>
AuthorDate: Wed Aug 10 13:37:09 2022 -0400

    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>
---
 guix/build/emacs-utils.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index fdca05602e..b2280ae70c 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]