emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

perl-mode indent bug


From: Karl Chen
Subject: perl-mode indent bug
Date: Tue, 11 Apr 2006 20:44:15 -0700

Perl-mode mis-indents this:
    {
        sub foo {
        }
    }

It always puts the "}" closing a subroutine whose opening "{" is
hanging at column 0, even when it should be matching the opening
line.

The patch below works for me.


2006-04-11  Karl Chen  <address@hidden>

        * progmodes/perl-mode.el (perl-indent-new-calculate): Recalculate
        parse-start in case we are inside a nested function.


--- perl-mode.el        10 Feb 2006 01:00:30 -0700      1.64
+++ perl-mode.el        11 Apr 2006 20:33:04 -0700      
@@ -721,6 +721,7 @@
        (save-excursion
          (forward-char 1)
          (forward-sexp -1)
+          (setq parse-start (save-excursion (perl-beginning-of-function)))
          (perl-indent-new-calculate 'virtual nil parse-start)))
    (and (and (= (following-char) ?{)
             (save-excursion (forward-char) (perl-hanging-paren-p)))


-- 
Karl 2006-04-11 20:39




reply via email to

[Prev in Thread] Current Thread [Next in Thread]