GNU bug report logs - #57122
[PATCH] build-system: emacs: Use new function for autoloads generation

Previous Next

Package: guix-patches;

Reported by: Morgan.J.Smith <at> outlook.com

Date: Wed, 10 Aug 2022 18:06:01 UTC

Severity: normal

Tags: patch

Done: Morgan Smith <Morgan.J.Smith <at> outlook.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Morgan.J.Smith <at> outlook.com
To: guix-patches <at> gnu.org
Cc: Morgan Smith <Morgan.J.Smith <at> outlook.com>, liliana.prikler <at> gmail.com
Subject: [PATCH] build-system: emacs: Use new function for autoloads generation
Date: Wed, 10 Aug 2022 13:37:09 -0400
From: Morgan Smith <Morgan.J.Smith <at> outlook.com>

* 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
---

I'm not sure how long it takes to rebuild all the Emacs packages so I CC'd Liliana since they are going to change the Emacs build system soon anyways.

This change is to allow packages to be built with the latest commits of emacs (guix build emacs-crdt --with-input=emacs-minimal=emacs-next --with-latest=emacs-next)

Just last week the 'update-directory-autoloads' function got deprecated and replaced.  Since continuing to use the deprecated function would require changes anyways (adding a '(require 'autoloads)' would do it I think), I decided to just use the newer function.

Is this a bug in upstream Emacs where autoloaded functions like 'update-directory-autoloads' don't get autoloaded when they are in the obsolete directory?  Possibly.  Is this a bug related to our packaging of Emacs?  Possibly.  Is this the intended behaviour?  Possibly.  I'm not the guy to ask :P. I'm really not sure why this stopped working.  But we will have to switch to the 'loaddefs-generate' function eventually anyways so I think this patch is probably good to apply.


Thanks,

Morgan


 guix/build/emacs-utils.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 8ee547f2b3..180c3ae08c 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -105,7 +105,11 @@ (define (emacs-generate-autoloads name directory)
   (let* ((file (string-append directory "/" name "-autoloads.el"))
          (expr `(let ((backup-inhibited t)
                       (generated-autoload-file ,file))
-                  (update-directory-autoloads ,directory))))
+                  (if (not (require 'loaddefs-gen nil t))
+                      ;; Emacs <= 28
+                      (update-directory-autoloads ,directory)
+                    ;; Emacs >= 29
+                    (loaddefs-generate ,directory ,file)))))
     (emacs-batch-eval expr #:dynamic? #t)))
 
 (define* (emacs-byte-compile-directory dir)
-- 
2.37.1





This bug report was last modified 1 year and 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.