unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* another perl-mode indent bug
@ 2006-04-27  2:55 Karl Chen
  2006-05-04 21:58 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Chen @ 2006-04-27  2:55 UTC (permalink / raw)



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

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

* Re: another perl-mode indent bug
  2006-04-27  2:55 another perl-mode indent bug Karl Chen
@ 2006-05-04 21:58 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2006-05-04 21:58 UTC (permalink / raw)
  Cc: emacs-devel

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

> indents the closing "}" incorrectly in perl-mode; the patch below
> works for me.

Thanks, installed.  There might be a better way to fix the problem, but that
patch seems good in itself.


        Stefan

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

end of thread, other threads:[~2006-05-04 21:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-27  2:55 another perl-mode indent bug Karl Chen
2006-05-04 21:58 ` Stefan Monnier

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).