all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: dbus: "(setenv ...)" not the same as "export ...=..."
Date: Tue, 01 Nov 2011 22:56:32 -0600	[thread overview]
Message-ID: <j8qihp$e6$1@dough.gmane.org> (raw)
In-Reply-To: <87wrbnz7le.fsf@micropit.couberia.bzh>

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




  parent reply	other threads:[~2011-11-02  4:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-29 23:44 dbus: "(setenv ...)" not the same as "export ...=..." Peter Münster
2011-10-30  8:51 ` Michael Albinus
2011-10-30 15:08   ` Peter Münster
2011-11-07 10:07     ` Michael Albinus
2011-11-02  4:56 ` Kevin Rodgers [this message]
2011-11-02 21:54   ` Peter Münster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='j8qihp$e6$1@dough.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.