From 1a02683ceeb6fbcebd0d7bb71dce448177f1d228 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 12 Oct 2021 13:56:47 +0200 Subject: [PATCH] Make dbus work in a dumped Emacs * lisp/net/dbus.el (dbus--init): Make into a defun. (after-pdump-load-hook): Put it onto the new pdump hook so that it's run after startup (bug#37331). --- lisp/net/dbus.el | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 560ece67517..3fff5398c06 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -2252,15 +2252,19 @@ keywords `:system-private' or `:session-private', respectively." bus nil dbus-path-local dbus-interface-local "Disconnected" #'dbus-handle-bus-disconnect))) - -;; Initialize `:system' and `:session' buses. This adds their file -;; descriptors to input_wait_mask, in order to detect incoming -;; messages immediately. -(when (featurep 'dbusbind) - (dbus-ignore-errors - (dbus-init-bus :system)) - (dbus-ignore-errors - (dbus-init-bus :session))) + +(defun dbus--init () + ;; Initialize `:system' and `:session' buses. This adds their file + ;; descriptors to input_wait_mask, in order to detect incoming + ;; messages immediately. + (when (featurep 'dbusbind) + (dbus-ignore-errors + (dbus-init-bus :system)) + (dbus-ignore-errors + (dbus-init-bus :session)))) + +(add-hook 'after-pdump-load-hook #'dbus--init) +(dbus--init) (provide 'dbus) -- 2.39.2