[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why does cperl-mode slaughter my formatting?
From: |
Harry Putnam |
Subject: |
Why does cperl-mode slaughter my formatting? |
Date: |
Sat, 01 Feb 2003 09:37:54 GMT |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) |
Try to ignore the horrible perl coding for a moment and just look at
the format:
open(FILE, "<./rcfile");
while(<FILE>){
if (/^<DIR>/) {
$save_dir = 'TRUE';
}
if(/^<\/DIR>/) {
$save_dir = "";
}
if($save_dir) {
push @directories,$_;
}
if(/^<HEADER_RE>/){
$save_hre = "TRUE";
}
if(/^<\/HEADER_RE>/) {
$save_hre = "";
}
if($save_hre) {
push @header_re,$_;
}
if(/^<BODY_RE>/){
$save_bre = "TRUE";
}
if(/^<\/BODY_RE>/) {
$save_bre = "";
}
if($save_bre) {
push @body_re,$_;
}
}
When I use C-M-\ to format above, cperl-mode does this:
open(FILE, "<./rcfile");
while (<FILE>) {
if (/^<DIR>/) {
$save_dir = 'TRUE';
}
if (/^<\/DIR>/) {
$save_dir = "";
}
if ($save_dir) {
push @directories,$_;
}
if (/^<HEADER_RE>/) {
$save_hre = "TRUE";
}
if (/^<\/HEADER_RE>/) {
$save_hre = "";
}
if ($save_hre) {
push @header_re,$_;
}
if (/^<BODY_RE>/) {
$save_bre = "TRUE";
}
if (/^<\/BODY_RE>/) {
$save_bre = "";
}
if ($save_bre) {
push @body_re,$_;
}
}
Surely that can't be a desireable format?
I'd hoped defaults would be good to work with, and maybe they are.
Anyone see how I'm screwing it up?
cperl-version's value is "4.32"
- Why does cperl-mode slaughter my formatting?,
Harry Putnam <=