unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Morgan.J.Smith@outlook.com
To: 57122@debbugs.gnu.org
Cc: Morgan Smith <Morgan.J.Smith@outlook.com>, liliana.prikler@gmail.com
Subject: [bug#57122] [PATCH] build-system: emacs: Use new function for autoloads generation
Date: Wed, 10 Aug 2022 13:37:09 -0400	[thread overview]
Message-ID: <DM5PR03MB31632CAA1BEDE81708A8AD6FC5659@DM5PR03MB3163.namprd03.prod.outlook.com> (raw)

From: Morgan Smith <Morgan.J.Smith@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





             reply	other threads:[~2022-08-10 18:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 17:37 Morgan.J.Smith [this message]
2022-08-10 19:57 ` [bug#57122] [PATCH] build-system: emacs: Use new function for autoloads generation Liliana Marie Prikler
2022-08-10 23:12   ` Morgan Smith
2022-08-18 12:43     ` Morgan Smith
2022-08-18 18:37       ` Liliana Marie Prikler

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=DM5PR03MB31632CAA1BEDE81708A8AD6FC5659@DM5PR03MB3163.namprd03.prod.outlook.com \
    --to=morgan.j.smith@outlook.com \
    --cc=57122@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    /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/guix.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).