emacs-devel
[Top][All Lists]
Advanced

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

another perl-mode indent bug


From: Karl Chen
Subject: another perl-mode indent bug
Date: Wed, 26 Apr 2006 19:55:27 -0700
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

This perl code:
     
    foo(
        sub {
            blah;
        }
        );

indents the closing "}" incorrectly in perl-mode; the patch below
works for me.  It changes `perl-beginning-of-function' to ignore
anonymous subs such as above.


--- /usr/share/emacs/22.0.50/lisp/progmodes/.backup/perl-mode.el.gz.~2~
+++ /usr/share/emacs/22.0.50/lisp/progmodes/perl-mode.el.gz
@@ -921,7 +921,7 @@
   (or arg (setq arg 1))
   (if (< arg 0) (forward-char 1))
   (and (/= arg 0)
-       (re-search-backward 
"^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
+       (re-search-backward 
"^\\s(\\|^\\s-*sub\\b\\s-*\\_<[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
                           nil 'move arg)
        (goto-char (1- (match-end 0))))
   (point))



-- 
Karl 2006-04-26 19:50





reply via email to

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