Add some remarks about Emacs editing modes

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5712 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-27 02:25:08 +00:00
parent 824180e6f8
commit 3723af9f32

View File

@ -59,6 +59,34 @@ use Shorewall::Rules;
use Shorewall::Proc; use Shorewall::Proc;
use Shorewall::Proxyarp; use Shorewall::Proxyarp;
#
# Note to the reader.
#
# I use Emacs perl-mode. It's advantages are:
#
# It's color theme is visible to color-blind people like me.
# It's indentation scheme is exactly the way I like.
#
# But:
#
# It doesn't understand 'here documents'.
#
# I've tried cperl-mode. It's adavantages are:
#
# It understands 'here documents'.
#
# But:
#
# It's color theme drives my eyes crazy.
# It's indentation scheme is unfathomable.
#
# Now I could spend my time trying to configure cperl-mode to do what I want; but why?
# Like most Open Source Software, it's documentation is pathetic. I would rather spend
# my time making Shorewall better rather than working around braindead editing modes.
#
# Bottom line. I use quoting techinques other than 'here documents'.
#
sub generate_script_1 { sub generate_script_1 {
copy $env{SHAREDIRPL} . 'prog.header'; copy $env{SHAREDIRPL} . 'prog.header';
@ -88,15 +116,14 @@ sub generate_script_1 {
emit 'TEMPFILE='; emit 'TEMPFILE=';
emit ''; emit '';
for my $exit qw/init start tcclear started stop stopped/ for my $exit qw/init start tcclear started stop stopped/ {
{ emit "run_${exit}_exit() {";
emit "run_${exit}_exit() {"; push_indent;
push_indent; append_file $exit;
append_file $exit; emit 'true';
emit 'true'; pop_indent;
pop_indent; emit "}\n";
emit "}\n"; }
}
emit 'initialize()'; emit 'initialize()';
emit '{'; emit '{';
@ -135,12 +162,13 @@ sub generate_script_1 {
'TERMINATOR=fatal_error' ); 'TERMINATOR=fatal_error' );
if ( $config{IPTABLES} ) { if ( $config{IPTABLES} ) {
emit "IPTABLES=\"$config{IPTABLES}\"\n"; emitj( "IPTABLES=\"$config{IPTABLES}\"",
emit "[ -x \"$config{IPTABLES}\" ] || startup_error \"IPTABLES=$config{IPTABLES} does not exist or is not executable\""; '',
"[ -x \"$config{IPTABLES}\" ] || startup_error \"IPTABLES=$config{IPTABLES} does not exist or is not executable\"" );
} else { } else {
emit '[ -z "$IPTABLES" ] && IPTABLES=$(mywhich iptables 2> /dev/null)'; emitj( '[ -z "$IPTABLES" ] && IPTABLES=$(mywhich iptables 2> /dev/null)',
emit ''; ''
emit '[ -n "$IPTABLES" -a -x "$IPTABLES" ] || startup_error "Can\'t find iptables executable"'; '[ -n "$IPTABLES" -a -x "$IPTABLES" ] || startup_error "Can\'t find iptables executable"' );
} }
append_file 'params' if $config{EXPORTPARAMS}; append_file 'params' if $config{EXPORTPARAMS};