[system] / trunk / pg / macros / PGbasicmacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/PGbasicmacros.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2173 Revision 2193
1071 1071
1072# This replaces M3. You can add new modes at will to this one. 1072# This replaces M3. You can add new modes at will to this one.
1073 1073
1074sub MODES { 1074sub MODES {
1075 my %options = @_; 1075 my %options = @_;
1076
1077 return $options{$displayMode} if defined $options{$displayMode};
1078
1079 if (exists $envir{displayModeFailover}->{$displayMode}) {
1080 my @backup_modes = @{$envir{displayModeFailover}->{$displayMode}};
1081 foreach my $mode (@backup_modes) {
1082 return $options{$mode} if defined $options{$mode};
1083 }
1084 die "ERROR in defining MODES: neither display mode $displayMode nor",
1085 " any fallback modes (", join(", ", @backup_modes), ") defined.\n";
1086 }
1087
1088 die "ERROR in defining MODES: current display mode '$displayMode' not found. available modes: ",
1089 join (", ", keys %{$envir{displayModeFailover}}), "\n";
1090
1076 return $options{$displayMode} 1091 return $options{$displayMode}
1077 if defined( $options{$displayMode} ); 1092 if defined( $options{$displayMode} );
1093
1094=for comment
1078 1095
1079 # default searches. 1096 # default searches.
1080 if ($displayMode eq "Latex2HTML") { 1097 if ($displayMode eq "Latex2HTML") {
1081 return $options{TeX} 1098 return $options{TeX}
1082 if defined( $options{TeX} ); 1099 if defined( $options{TeX} );
1118 1135
1119 # trap undefined errors 1136 # trap undefined errors
1120 die "ERROR in defining MODES: Can't find |$displayMode| among 1137 die "ERROR in defining MODES: Can't find |$displayMode| among
1121 available options:" . join(" ", keys(%options) ) 1138 available options:" . join(" ", keys(%options) )
1122 . " file " . __FILE__ ." line " . __LINE__."\n\n"; 1139 . " file " . __FILE__ ." line " . __LINE__."\n\n";
1140
1141=cut
1123 1142
1124} 1143}
1125 1144
1126 1145
1127# end display macros 1146# end display macros

Legend:
Removed from v.2173  
changed lines
  Added in v.2193

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9