From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 65575@debbugs.gnu.org
Subject: bug#65575: [PATCH 3/3] gnu: emacs: Reload subdirs.el files in 'guix-emacs-autoload-packages'.
Date: Tue, 29 Aug 2023 22:07:46 +0200 [thread overview]
Message-ID: <81e6491a09388339ff1a41f1d1eb72a286f3290c.camel@gmail.com> (raw)
In-Reply-To: <87il8zgpm7.fsf@gmail.com>
Am Montag, dem 28.08.2023 um 11:20 -0400 schrieb Maxim Cournoyer:
> > e.g.
> > (defun guix-emacs-autoload-packages (&optional reload)
> > "..."
> > (interactive "P")
> > (when reload (mapc #'load-file (guix-emacs--subdirs-files)))
> > ...)
> >
> > WDYT?
>
> The reason for avoiding loading the subdirs.el files on the first
> call is just an optimization, since it would at this time duplicate
> work already done by Emacs itself when it first executes. This
> shouldn't fail; I've now employed the same 'noerror strategy as used
> for autoloads to ensure that.
>
> There's one edge case I've just thought though, which is if a user
> invoked emacs with the documented '--no-site-file' option disabling
> loading autoloads; this would cause guix-emacs-autoload-packages-
> called to be nil.
>
> To balance between making things both convenient and flexible, I've
> preserved the tracking but also added the reload override you
> suggested. Let me know what you think.
Assuming convenience equates to not needing to type C-u, we can also
achieve that without tracking:
(defun guix-emacs-autoload-packages (&optional noexpand)
"Autoload Emacs packages found in EMACSLOADPATH.
'Autoload' means to load the 'autoloads' files matching
`guix-emacs-autoloads-regexp'. Before doing so, expand load-path by
loading subdirs.el files found in it, unless NOEXPAND is given."
(interactive "P")
(unless noexpand (mapc #'load-file (guix-emacs--subdirs-files)))
...)
In our own init code, we should simply call it as
(guix-emacs-autoload-packages 'noexpand)
then, since this expansion is already done earlier by Emacs.
Cheers
next prev parent reply other threads:[~2023-08-29 20:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 4:50 bug#65575: guix-emacs-autoload-packages does not autoreload newly installed packages Maxim Cournoyer
2023-08-28 5:07 ` bug#65575: [PATCH 1/3] gnu: emacs: Use lexical binding for guix-emacs.el startup library Maxim Cournoyer
2023-08-28 5:11 ` Maxim Cournoyer
2023-08-28 5:11 ` bug#65575: [PATCH 2/3] gnu: emacs: Factorize a 'guix-emacs--subdirs-files' procedure Maxim Cournoyer
2023-08-28 5:11 ` bug#65575: [PATCH 3/3] gnu: emacs: Reload subdirs.el files in 'guix-emacs-autoload-packages' Maxim Cournoyer
2023-08-28 6:16 ` Liliana Marie Prikler
2023-08-28 15:20 ` Maxim Cournoyer
2023-08-29 20:07 ` Liliana Marie Prikler [this message]
2023-08-28 15:16 ` bug#65575: [PATCH v2 1/4] gnu: emacs: Use lexical binding for guix-emacs.el startup library Maxim Cournoyer
2023-08-28 15:16 ` bug#65575: [PATCH v2 2/4] gnu: emacs: Factorize a 'guix-emacs--subdirs-files' procedure Maxim Cournoyer
2023-08-28 15:16 ` bug#65575: [PATCH v2 3/4] gnu: emacs: Allow producing verbose messages when loading autoloads Maxim Cournoyer
2023-08-28 15:16 ` bug#65575: [PATCH v2 4/4] gnu: emacs: Reload subdirs.el files in 'guix-emacs-autoload-packages' Maxim Cournoyer
2023-08-28 16:55 ` Liliana Marie Prikler
2023-09-01 4:53 ` bug#65575: [PATCH v3 1/4] gnu: emacs: Use lexical binding for guix-emacs.el startup library Maxim Cournoyer
2023-09-01 4:53 ` bug#65575: [PATCH v3 2/4] gnu: emacs: Factorize a 'guix-emacs--subdirs-files' procedure Maxim Cournoyer
2023-09-01 4:53 ` bug#65575: [PATCH v3 3/4] gnu: emacs: Allow producing verbose messages when loading autoloads Maxim Cournoyer
2023-09-01 4:53 ` bug#65575: [PATCH v3 4/4] gnu: emacs: Reload subdirs.el files in 'guix-emacs-autoload-packages' Maxim Cournoyer
2023-09-02 4:49 ` Liliana Marie Prikler
2023-09-03 14:51 ` Maxim Cournoyer
2023-09-03 19:59 ` Liliana Marie Prikler
2023-09-09 8:20 ` Liliana Marie Prikler
2023-09-09 13:04 ` Maxim Cournoyer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81e6491a09388339ff1a41f1d1eb72a286f3290c.camel@gmail.com \
--to=liliana.prikler@gmail.com \
--cc=65575@debbugs.gnu.org \
--cc=maxim.cournoyer@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.