summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-10-12 13:56:47 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-10-12 13:57:52 +0200
commit1a02683ceeb6fbcebd0d7bb71dce448177f1d228 (patch)
treee58c619f5806b63ce9988eae919a558bc85d93b7
parent6d68fbd57f730051dd3af470e7b0c41b41238bd0 (diff)
downloademacs-1a02683ceeb6fbcebd0d7bb71dce448177f1d228.tar.gz
emacs-1a02683ceeb6fbcebd0d7bb71dce448177f1d228.tar.bz2
emacs-1a02683ceeb6fbcebd0d7bb71dce448177f1d228.zip
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).
-rw-r--r--lisp/net/dbus.el22
1 files 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)