From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: dbus: "(setenv ...)" not the same as "export ...=..." Date: Tue, 01 Nov 2011 22:56:32 -0600 Message-ID: References: <87wrbnz7le.fsf@micropit.couberia.bzh> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1320209815 585 80.91.229.12 (2 Nov 2011 04:56:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2011 04:56:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 02 05:56:52 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RLSsb-0007R8-1q for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Nov 2011 05:56:49 +0100 Original-Received: from localhost ([::1]:33842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLSsa-0000mi-B5 for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Nov 2011 00:56:48 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLSsV-0000mY-JD for help-gnu-emacs@gnu.org; Wed, 02 Nov 2011 00:56:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLSsU-0004YE-Ft for help-gnu-emacs@gnu.org; Wed, 02 Nov 2011 00:56:43 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:57915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLSsU-0004Xw-8H for help-gnu-emacs@gnu.org; Wed, 02 Nov 2011 00:56:42 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RLSsQ-0007Nn-9W for help-gnu-emacs@gnu.org; Wed, 02 Nov 2011 05:56:38 +0100 Original-Received: from c-71-237-25-24.hsd1.co.comcast.net ([71.237.25.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Nov 2011 05:56:38 +0100 Original-Received: from kevin.d.rodgers by c-71-237-25-24.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Nov 2011 05:56:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-25-24.hsd1.co.comcast.net 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 In-Reply-To: <87wrbnz7le.fsf@micropit.couberia.bzh> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82725 Archived-At: 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