[comp.soft-sys.andrew] Selective *.formatcommand and *.printcommand

cvenkat@IAG.HP.COM (Chandra Venkatraman) (06/04/91)

Is it possible to have different .formatcommand and .printcommand
depending on the printer chosen from the 'set printer' menu option?
We have different printers and I would like to have .formatcommand
slightly different if one specific printer is chosen.

Thanks
Chandra

gk5g+@ANDREW.CMU.EDU (Gary Keim) (06/04/91)

Excerpts from misc: 3-Jun-91 Selective *.formatcommand a.. Chandra
Venkatraman@iag. (272)

> Is it possible to have different .formatcommand and .printcommand
> depending on the printer chosen from the 'set printer' menu option?
> We have different printers and I would like to have .formatcommand
> slightly different if one specific printer is chosen.


You can have preferences that are dependant on environment variables. 
Try % help preferences.

Environment-specific preferences

    If you need to have preferences that are only active when a certain
    environment variable is set, you can use the following preference
    forms:

    ?E=environmentvariable=value:preference
    ?E!environmentvariable=value:preference

    Meaningful colons within these specifications can be quoted with the
    backslash character ("\").  For example, the following line would
    cause typescripts you start while the "DISPLAY" environment variable
    is "pgh:0" to be 600x600 pixels.

    ?E=DISPLAY=pgh\:0:typescript.geometry:600x600

You could have some preference lines like this:

?E=PRINTER=plum:*.formatcommander: <foo bar>

... where formatcommand would be <foo bar> when the environment variable
PRINTER is set to "plum."  Will this do the trick?

Gary Keim
ATK Group