From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Chen Newsgroups: gmane.emacs.devel Subject: another perl-mode indent bug Date: Wed, 26 Apr 2006 19:55:27 -0700 Message-ID: Reply-To: quarl+dated+1146538235.e8f406@nospam.quarl.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146106590 633 80.91.229.2 (27 Apr 2006 02:56:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Apr 2006 02:56:30 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 27 04:56:28 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FYwg4-0000Uc-Oe for ged-emacs-devel@m.gmane.org; Thu, 27 Apr 2006 04:56:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYwg4-0003dm-CF for ged-emacs-devel@m.gmane.org; Wed, 26 Apr 2006 22:56:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYwfr-0003dT-Qb for emacs-devel@gnu.org; Wed, 26 Apr 2006 22:56:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYwfq-0003dF-LX for emacs-devel@gnu.org; Wed, 26 Apr 2006 22:56:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYwfq-0003dC-Fn for emacs-devel@gnu.org; Wed, 26 Apr 2006 22:56:10 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FYwie-0007bb-Tb for emacs-devel@gnu.org; Wed, 26 Apr 2006 22:59:05 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FYwff-0000Ph-Jr for emacs-devel@gnu.org; Thu, 27 Apr 2006 04:55:59 +0200 Original-Received: from roar.cs.berkeley.edu ([128.32.35.215]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Apr 2006 04:55:59 +0200 Original-Received: from quarl by roar.cs.berkeley.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Apr 2006 04:55:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 30 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: roar.cs.berkeley.edu X-Quack-Archive: 1 Gmane-From: 1 User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:RgfaRsHXNcc52+XgzwoHi0gTTGQ= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53494 Archived-At: 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