[comp.mail.elm] Default Pager

chaffee@reed.UUCP (Alex Chaffee) (11/03/90)

I asked this question a month or two ago, and didn't get any answers, so
I'll try again:

The behavior of elm 2.3 (PL6) with respect to picking a pager is as follows:

-	If there is an elmrc file, it uses the pager specified
-	If there is no elmrc file
	-	If there is an environment variable called "PAGER", it uses
		that
	-	Otherwise, it uses the compiled-in #define DEF_PAGER (or
		something like that; I can't recall the name)

This is a problem for me.  I want new users to use the builtin pager, but
all users have the $PAGER variable defined in their .cshrc file (for use by
rn etc.).  Is there any way to have elm ignore the $PAGER environment
variable in the absence of an elmrc file, and use the #define instead?  If
not, can this be worked into 2.4, perhaps as an additional #define?

 - Alex
-- 
Alex Chaffee
chaffee@reed.{UUCP,BITNET}
Reed College, Portland OR 97202
____________________

mason@oct1.UUCP (David Mason) (11/13/90)

In article <15645@reed.UUCP> chaffee@reed.UUCP (Alex Chaffee) writes:
>I want new users to use the builtin pager, but
>all users have the $PAGER variable defined in their .cshrc file (for use by
>rn etc.).  Is there any way to have elm ignore the $PAGER environment
>variable in the absence of an elmrc file, and use the #define instead? 

One could easily write a small wrapper for elm which unsets any environ-
ment variables, then resets them aftwards.  Alternately write wrappers
for those programs that you want $PAGER to be set for.  In this way
you can probably control the settings and options more tightly, and the
default environment will be preserved even if the application does not
exit properly.

An example of the former under ksh:
elm () {
unset PAGER
/usr/bin/elm
PAGER='pg -n'
export PAGER
}

or alternately the latter under ksh:
alias rn='PAGER=pg EDITOR=vi rn -T -h -S1'

Probably easier that rewriting elm, and more generally applicable.
--------------------
David        |      mason@oct1.UUCP (David Mason)
             |      olsa99!oct1!mason@ddsw1.MCS.COM
             |      <well connected>!ddsw1!olsa99!oct1!mason

wnp@iiasa.ac.at (wolf paul) (11/21/90)

In article <1990Nov13.150124.1721@oct1.UUCP> mason@oct1.UUCP (David Mason) writes:
)In article <15645@reed.UUCP> chaffee@reed.UUCP (Alex Chaffee) writes:
)>I want new users to use the builtin pager, but
)>all users have the $PAGER variable defined in their .cshrc file (for use by
)>rn etc.).  Is there any way to have elm ignore the $PAGER environment
)>variable in the absence of an elmrc file, and use the #define instead? 
)
)One could easily write a small wrapper for elm which unsets any environ-
)ment variables, then resets them aftwards. ...
)
)An example of the former under ksh:
) (using a shell function to unset PAGER, run rn, re-set PAGER)

Actually, using a shell script which sets PAGER to whatever (or unsets
it, for that matter) and then execs the real elm will do the trick
with no risks if elm terminates abnormally.

And of course it works for all other environment variables, and other
programs, as well.
--
W.N.Paul, Int. Institute f. Applied Systems Analysis, A-2361 Laxenburg--Austria
PHONE: +43-2236-71521-465            INTERNET: wnp%iiasa@relay.eu.net
FAX:   +43-2236-71313                UUCP:     uunet!iiasa!wnp
HOME:  +43-2236-618514               BITNET:   tuvie!iiasa!wnp@awiuni01.BITNET