Subject: FVWM: Emacs does not print when started from FVWM-Buttons

From: Andreas Schumann <[email-masked]>
Date: Wed, 14 May 1997 09:02:50 -0400

Hi,
 
I'm running Redhat LINUX from an Intel Pentium using FVWM2.
 
When I start Emacs from my button bar
 
*FvwmButtons (Title "Emacs", Action `Exec emacs &', Icons emacs.xpm)
 
the print function in Emacs does not work. Normally my environment is
set
in /etc/csh.cshrc to (using tcsh)
 
setenv PRINTER "dj500"
 
in order to print from a C-Shell or a program started from a C-Shell.
However, this setting is obviously not available for programs started
from
the button bar?
 
Does anybody know how to solve this problem?
 
Any help is appreciated!
 
Andreas Schumann
Department of Mechanical Engineering
Queen's University
Kingston, Ontario, Canada
K7L 3N6
e-mail: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Kendrick Vargas <[email-masked]>
Date: Tue, 13 May 1997 22:18:33 -0400 (EDT)

On Wed, 14 May 1997, Andreas Schumann wrote:

> set in /etc/csh.cshrc to (using tcsh)
>  
> setenv PRINTER "dj500"
>  
> from the button bar?

Well, I guess it would be solved by the window manager making available to
the programs, all the environments that it has available to itself as
defined by the shell that starts the window manager... What I mean is that
the .xsession or .xinitrc or WHATEVER that calls fvwm2 is simply a shell
script, and if you set environments within that shell script, fvwm2 should
make those environments available to the programs that fvwm2 starts...
Currently, only a few environments are made available to programs...
$HOME, $PATH, $LD_LIBRARY_PATH, and a few other vital ones... 

What you could do is create a little wrap around shell script to run all
your programs... If you use the cshell by default, it could look like
this:

------ Begin CSH shell script -----

#!/bin/csh -f
# This is a csh wrapper to start an X app with certain default system
# environments

# The following sources the system default .cshrc
source /etc/csh.cshrc

# Here we add any other possibly required miscellaneous variables

#setenv ENVIRONMENT blah

# Here we execute whatever arguments are thrown at us...

exec $*

----- end CSH shell script -----

A similar /bin/sh script would be easy. Simply throw this into
/usr/X11/bin (for example called fXrun -- for fvwm2 X run, or something)
and then in your .fvwm2rc, call programs with it:

+	"Emacs"		Exec exec fXrun emacs --someoption \
				 --someotheroption &
+	"xv"		Exec exec fXrun xv &

and that'd be it...
			-peace

--- BEGIN GEEK CODE BLOCK ------------+-----------
GAT d- s:+ !a C+(+++) UI/L/S/B++(+++) | "In the morning glad I see
P>+ L+(++) E---- W+++ N+ o? K? w++++  |  My foe outstrech'd beneath the tree."
O--- M-- V PS+++@ PE Y-- PGP+ t++ 5   |               -The Poison Tree
X++ R- tv+ b DI++ D+ G e>*  h*(!) r-  |                William Blake
y*(+) ------ END GEEK CODE BLOCK -----+

---

From: Bruce Stephens <[email-masked]>
Date: Wed, 14 May 1997 10:23:03 +0100

[email-masked] said:
> What I mean is that the .xsession or .xinitrc or WHATEVER that calls 
> fvwm2 is simply a shell script, and if you set environments within 
> that shell script, fvwm2 should make those environments available to 
> the programs that fvwm2 starts... Currently, only a few environments 
> are made available to programs... $HOME, $PATH, $LD_LIBRARY_PATH, and 
> a few other vital ones...

Is that true?  My understanding was that all environment variables got passed 
on (so long as the shell which runs .xsession or whatever exports them, of 
course).  Is this not true?  Does fvwm2 *really* pick and choose which 
variables to pass on?

What's more likely is that the person is running xdm, which runs .xsession, 
and so never actually runs csh at all until they get an xterm up.  So the 
environment variables exist in the xterms, but not in anything else, and in 
particular not in fvwm2 and modules.  The trick there is to ensure that the 
variables are set (and exported) in .xsession or .xinitrc.

---

From: Carvel Baus <[email-masked]>
Date: Wed, 14 May 1997 08:53:32 -0400

I agree with Bruce. I had a similar problem with emacs and Fvwm not
recognizing my environment variables and it was because I had a check
in my .cshrc that looked to see if it was being 'executed' in an
interactive shell or not. If not (which is the case when I first
login), then it would exit at that point and not finish the stuff
below it. A lot of my environment variables happened to be set below
this checkpoint so I was losing them in Fvwm and anything else that was
started from the .xinitrc. My xterms were fine because they were
interactive.

I would suggest reading the man pages for login and csh or whatever
shell you use to really understand the order of things.

Carvel

>>>>> "Bruce" == Bruce Stephens <[email-masked]> writes:

Bruce> [email-masked] said:
>> What I mean is that the .xsession or .xinitrc or WHATEVER that
>> calls fvwm2 is simply a shell script, and if you set environments
>> within that shell script, fvwm2 should make those environments
>> available to the programs that fvwm2 starts... Currently, only a
>> few environments are made available to programs... $HOME, $PATH,
>> $LD_LIBRARY_PATH, and a few other vital ones...

Bruce> Is that true?  My understanding was that all environment
Bruce> variables got passed on (so long as the shell which runs
Bruce> .xsession or whatever exports them, of course).  Is this not
Bruce> true?  Does fvwm2 *really* pick and choose which variables to
Bruce> pass on?

Bruce> What's more likely is that the person is running xdm, which
Bruce> runs .xsession, and so never actually runs csh at all until
Bruce> they get an xterm up.  So the environment variables exist in
Bruce> the xterms, but not in anything else, and in particular not in
Bruce> fvwm2 and modules.  The trick there is to ensure that the
Bruce> variables are set (and exported) in .xsession or .xinitrc.

Bruce> -- Visit the official FVWM web page at
Bruce> <URL:http://www.hpc.uh.edu/fvwm/>.  To unsubscribe from the
Bruce> list, send "unsubscribe fvwm" in the body of a message to
Bruce> [email-masked].  To report problems, send mail to
Bruce> [email-masked].