diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2023-06-12 12:45:38 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2023-06-12 12:45:38 +0200 |
commit | 1383efe01d0ee8ba3ea8da5ab41b07f5672191bf (patch) | |
tree | 7145ae70b17fe202d11357608845783e96b1d5b0 /doc | |
parent | bdb0bc2b4e44a7d40369e10e3de825d58fe46825 (diff) | |
download | emacs-1383efe01d0ee8ba3ea8da5ab41b07f5672191bf.tar.gz emacs-1383efe01d0ee8ba3ea8da5ab41b07f5672191bf.tar.bz2 emacs-1383efe01d0ee8ba3ea8da5ab41b07f5672191bf.zip |
Fix setting $DBUS_SESSION_BUS_ADDRESS after Emacs has started
* doc/misc/dbus.texi (Alternative Buses): Explain using
$DBUS_SESSION_BUS_ADDRESS after Emacs has started.
* src/dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Use egetenv.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/misc/dbus.texi | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index 97a0f39ea13..2bd6b9556c8 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi @@ -1847,8 +1847,24 @@ This function establishes the connection to D-Bus @var{bus}. corresponding bus. For the system and session buses, this function is called when loading @file{dbus.el}, there is no need to call it again. -The function returns the number of connections this Emacs session has -established to the @var{bus} under the same unique name +If Emacs was invoked when there was no D-Bus session bus available +yet, you can set the environment variable +@env{DBUS_SESSION_BUS_ADDRESS} once the session bus daemon is running +and offering the address. Calling @code{dbus-init-bus} initializes +the connection to the session bus. + +@lisp +(setenv "DBUS_SESSION_BUS_ADDRESS" "unix:path=/run/user/1000/bus") + +@result{} "unix:path=/run/user/1000/bus" + +(dbus-init-bus :session) + +@result{} 2 +@end lisp + +@code{dbus-init-bus} returns the number of connections this Emacs +session has established to the @var{bus} under the same unique name (@pxref{dbus-get-unique-name}). It depends on the libraries Emacs is linked with, and on the environment Emacs is running. For example, if Emacs is linked with the GTK+ toolkit, and it runs in a GTK+-aware |