unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* perl-mode indent bug
@ 2006-04-12  3:44 Karl Chen
  2006-04-12  5:11 ` Stefan Monnier
  2006-04-12 12:42 ` cperl-mode instead of perl-mode? (was Re: perl-mode indent bug) Randal L. Schwartz
  0 siblings, 2 replies; 23+ messages in thread
From: Karl Chen @ 2006-04-12  3:44 UTC (permalink / raw)



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  <quarl@cs.berkeley.edu>

        * 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

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

end of thread, other threads:[~2006-04-18 14:56 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-12  3:44 perl-mode indent bug Karl Chen
2006-04-12  5:11 ` Stefan Monnier
2006-04-12 12:42 ` cperl-mode instead of perl-mode? (was Re: perl-mode indent bug) Randal L. Schwartz
2006-04-12 13:18   ` Randal L. Schwartz
2006-04-12 15:16     ` Stuart D. Herring
2006-04-12 15:21       ` Randal L. Schwartz
2006-04-12 14:44   ` cperl-mode instead of perl-mode? Stefan Monnier
2006-04-13 18:51     ` Ted Zlatanov
2006-04-14 16:15       ` Richard Stallman
2006-04-18 14:56         ` Ted Zlatanov
2006-04-12 21:46   ` cperl-mode instead of perl-mode? (was Re: perl-mode indent bug) Richard Stallman
2006-04-12 21:58     ` Randal L. Schwartz
2006-04-13 16:38       ` Richard Stallman
2006-04-13 17:08         ` Randal L. Schwartz
2006-04-13 17:10         ` cperl-mode instead of perl-mode? Stefan Monnier
2006-04-14 16:15           ` Richard Stallman
2006-04-14 20:35             ` Stefan Monnier
2006-04-15  0:27               ` Randal L. Schwartz
2006-04-15  1:37                 ` Stefan Monnier
2006-04-16  2:09                   ` Richard Stallman
2006-04-15 17:32               ` Richard Stallman
2006-04-15 11:45   ` Piet van Oostrum
2006-04-15 13:36     ` Randal L. Schwartz

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).