all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Why does cperl-mode slaughter my formatting?
@ 2003-02-01  9:37 Harry Putnam
  2003-02-01 12:22 ` Unknown
  0 siblings, 1 reply; 6+ messages in thread
From: Harry Putnam @ 2003-02-01  9:37 UTC (permalink / raw)


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"

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-03 14:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-01  9:37 Why does cperl-mode slaughter my formatting? Harry Putnam
2003-02-01 12:22 ` Unknown
2003-02-01 19:43   ` Harry Putnam
2003-02-02  2:57     ` Harry Putnam
2003-02-03 14:21       ` Martin Jost
2003-02-02  4:51     ` Joe Casadonte

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.