🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.sysadmin
3 messages
3 total messages Started by Christopher B. Moore Fri, 24 Jul 1992 14:29
Emacs environment variable lost
#210
Author: Christopher B. Moore
Date: Fri, 24 Jul 1992 14:29
8 lines
756 bytes
I've noticed (while installing the Auc-TeX package) that evaluation of
(getenv "HOSTTYPE") in an Emacs2.1 window started by clicking on the
Emacs2.1 icon in the workspace returns nil.  However, in an Emacs2.1
window started from the commandline it returns "next".  What gives?

Christopher B. Moore
cmoore@maggie.mit.edu
Re: Emacs environment variable lost
#225
Author: Patrice Belleville
Date: Fri, 24 Jul 1992 14:56
26 lines
1534 bytes
From article <CMOORE.92Jul24092902@zenobia.mit.edu>, by cmoore@zenobia.mit.edu (Christopher B. Moore):
> 
> I've noticed (while installing the Auc-TeX package) that evaluation of
> (getenv "HOSTTYPE") in an Emacs2.1 window started by clicking on the
> Emacs2.1 icon in the workspace returns nil.  However, in an Emacs2.1
> window started from the commandline it returns "next".  What gives?
> 
> Christopher B. Moore
> cmoore@maggie.mit.edu


	Well, the problem is that the  workspace does not  run your .login or
your .cshrc.   So programs  started from it  will not  have access  to   your
favorite environment variables. One fix is to add the following lines to your
.emacs file:

(setq process-environment (append
        process-environment
	'("HOSTTYPE=next" "OTHERVAR=othervalue" [more of these])))


-- 
/***************************************************************************\
|* Patrice Belleville 					 patrice@cs.sfu.ca *|
|*   --- Simon Fraser University is not responsible for my mistakes. ---   *|
\***************************************************************************/
Re: Emacs environment variable lost
#214
Author: Carl Edman
Date: Fri, 24 Jul 1992 15:48
22 lines
1566 bytes
Christopher B. Moore writes
> I've noticed (while installing the Auc-TeX package)
> that evaluation of (getenv "HOSTTYPE") in an Emacs2.1
> window started by clicking on the Emacs2.1 icon in the
> workspace returns nil.  However, in an Emacs2.1 window
> started from the commandline it returns "next".  What
> gives? 

Why, environment variables aren't global - they are inherited. And the parent  
of all programs started by the Workspace is (surprise !) Workspace. And  
Workspace does not have any environment variables set. If you start a NeXTstep  
program directly from the commandline its parent is the shell so your  
application inherits all the shell environment variables. (BTW, the better way  
to do this is not to start applications directly from the command line but  
instead to tell Workspace to do it from the command line, see man page on  
open(1)).

EPS wrote a hack to get enviroment variables for the Workspace which involved  
installing a shell script as Workspace replacement. This shell script then sets  
the environment variables and execs the real Workspace.

	Carl Edman
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads