[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Site-wide package customization
From: |
Stefan Monnier |
Subject: |
Re: Site-wide package customization |
Date: |
Sat, 17 May 2025 12:10:31 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
>> Plus, this approach is not practical for other site configurations:
>> namely Linux distributions. I'm realizing now that being able to
>> customize package.el site-wide would make it a lot easier for Linux
>> distributions (at least my preferred one, NixOS) to ship Emacs
>> packages as distribution packages.
>
> If we are bothered by what the distros do, we should talk to at least
> some of them. Up front, it sounds unlikely they have problems,
> because they would approach us with bug reports when the early-init
> filre was added in Emacs 27.
I just checked Debian, and they're still using the same old patch:
From 5a2dcc0916119e008cb5ecfa02e99915e86a27fa Mon Sep 17 00:00:00 2001
From: Rob Browning <rlb@defaultvalue.org>
Date: Mon, 4 Apr 2011 22:46:22 -0500
Subject: Run debian-startup and set debian-emacs-flavor
Emacs runs debian-startup and sets debian-emacs-flavor.
* Emacs runs debian-startup during the startup process unless
site-run-file is false.
* The global variable debian-emacs-flavor is bound to 'emacs.
Author: Rob Browning <rlb@defaultvalue.org>
---
lisp/startup.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/lisp/startup.el b/lisp/startup.el
index 7ec500dfecb..e07e6515991 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -441,6 +441,10 @@ tutorial-directory
:type 'directory
:initialize #'custom-initialize-delay)
+(defconst debian-emacs-flavor 'emacs
+ "A symbol representing the particular debian flavor of emacs running.
+Something like 'emacs, 'xemacs21, etc.")
+
(defun normal-top-level-add-subdirs-to-load-path ()
"Recursively add all subdirectories of `default-directory' to
`load-path'.
More precisely, this uses only the subdirectories whose names
@@ -1493,7 +1497,14 @@ command-line
;; Sites should not disable the startup screen.
;; Only individuals should disable the startup screen.
(let ((inhibit-startup-screen inhibit-startup-screen))
- (load site-run-file t t)))
+ (progn
+ ;; This form has been added by Debian to load all the
+ ;; debian package snippets (dh-elpa, etc.). It's in here
+ ;; because we want -q to kill it too.
+ (if (load "debian-startup" t t nil)
+ (debian-startup debian-emacs-flavor))
+ ;; This is the normal upstream behavior
+ (load site-run-file t t))))
;; Load that user's init file, or the default one, or none.
(startup--load-user-init-file
So I assume they simply haven't noticed that their `debian-startup` is
now loaded after `early-init.el` and after `package-quickstart.el`.
I suspect this is because both of those files are used only rarely,
mostly by "power users", and I expect many(most?) of those power users
would tend not to use (or even to avoid) most of what the
`debian-startup` might do.
Stefan
PS: Loading `site-start.el` earlier also means loading it before
creating the GUI/TUI frame. In the past I would have been worried by
such a change, but I think nowadays running Emacs as a daemon is
common enough that a `site-start.el` which burps if run before
having a GUI/TUI frame is highly unlikely.
- Site-wide package customization, Spencer Baugh, 2025/05/16
- Re: Site-wide package customization, Eli Zaretskii, 2025/05/16
- Re: Site-wide package customization, Spencer Baugh, 2025/05/17
- Re: Site-wide package customization, Eli Zaretskii, 2025/05/17
- Re: Site-wide package customization, Spencer Baugh, 2025/05/17
- Re: Site-wide package customization, Eli Zaretskii, 2025/05/17
- Re: Site-wide package customization,
Stefan Monnier <=
- Re: Site-wide package customization, Eli Zaretskii, 2025/05/17
- Re: Site-wide package customization, Stefan Monnier, 2025/05/17
- Re: Site-wide package customization, Ulrich Müller, 2025/05/18
- Re: Site-wide package customization, Spencer Baugh, 2025/05/18
- Re: Site-wide package customization, Ulrich Müller, 2025/05/19
- Re: Site-wide package customization, Eli Zaretskii, 2025/05/19
- Re: Site-wide package customization, Ulrich Müller, 2025/05/19
- Re: Site-wide package customization, Eli Zaretskii, 2025/05/19
- Re: Site-wide package customization, Spencer Baugh, 2025/05/22
- Re: Site-wide package customization, Eli Zaretskii, 2025/05/22