* 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
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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.