help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dbus: "(setenv ...)" not the same as "export ...=..."


From: Kevin Rodgers
Subject: Re: dbus: "(setenv ...)" not the same as "export ...=..."
Date: Tue, 01 Nov 2011 22:56:32 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.23) Gecko/20110920 Thunderbird/3.1.15

On 10/29/11 5:44 PM, Peter Münster wrote:
Hello,

Emacs is the only program, that requires the DBUS_SESSION_BUS_ADDRESS
environment variable, so instead of setting it in the global environment,
I prefer to set it in my .emacs file:

--8<---------------cut here---------------start------------->8---
(when window-system
   (unless (getenv "DBUS_SESSION_BUS_ADDRESS")
     (setenv "DBUS_SESSION_BUS_ADDRESS" "autolaunch:"))
   (require 'notifications))
--8<---------------cut here---------------end--------------->8---

But it does not work: D-Bus error: "No connection to bus", :session

The workaround is to start emacs like this:
DBUS_SESSION_BUS_ADDRESS=autolaunch: emacs

Could anybody explain, why emacs needs the DBUS_SESSION_BUS_ADDRESS (or
why other programs don't need it), and why setting it with (setenv ...)
does not work?

setenv modifies the process-environment variable, which affects subprocesses
of the Emacs OS process.  If setting a variable with setenv doesn't work, I
think it means that the OS process that reads the variable was not spawned
from Emacs (or the process was spawned before the variable was set).

Could the process that reads DBUS_SESSION_BUS_ADDRESS be Emacs itself?

TIA for any hints!

P.S.: I don't know, where the dbus is started on my system, the parent
PID is 1. Perhaps from xinit or fvwm, how can I know?

More guesses:

/etc/init (/etc/init.d, /etc/rc*.d)
/etc/services

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]