in reply to EMACS cperl mode misbehaving

To get Emacs to exhibit this behavior, select PERL / "Mark Function". Then PERL / "Indent Region". I spent a little time in Google and found this little gem:
+;;; (`cperl-fix-line-spacing'): Allow "_" in $vars of foreach etc. w +hen +;;; underscore isn't a word char (gdj-contributed).
So I added this:
;; Allow "_" in $vars of foreach '(cperl-fix-line-spacing)
to my .emacs file, but apparently its not doing what I expected because variable names in a for loop with an underscore still get "split". Feels like I'm on the right track, but sometimes EMACS behavior is a mystery to me.

Replies are listed 'Best First'.
Re^2: EMACS cperl mode misbehaving
by bluto (Curate) on May 06, 2005 at 16:01 UTC
    I'm using an old version of emacs (20.4) and it has a variable called cperl-under-as-char which I can Customize. It's set to 't' for me (by default I think, since I don't remember ever changing this) and everything seems to be working. Type "M-x apropos cperl" and look around some. FWIW the docs for cperl-fix-line-spacing don't mention anything about fixing spacing for underscore, but they are pretty sparce.