From: "Giuliano Procida" <giuliano.procida@googlemail.com>
To: bug-gnu-emacs@gnu.org
Subject: perl-mode - fix syntax of anonymous sub prototypes
Date: Fri, 28 Mar 2008 17:37:08 +0000 [thread overview]
Message-ID: <5c8016cf0803281037q5c64bd21le5e3359ddadca955@mail.gmail.com> (raw)
Hi.
GNU Emacs 22.1.1 (i386-pc-solaris2.10, X toolkit) of 2008-02-11 on robot
Constructs like this:
my $del = sub($) {
my ($old) = @_;
return if not active($old);
&$delete_row($old->{$fde_id});
};
upset later indentation as the $ in the sub($) has the default
backslash syntax class (instead of being treated specially as in
non-anonymous sub definitions) and then the "sub(" triggers the
hanging parens check.
The fix is to modify perl-font-lock-syntactic-keywords to have:
;; Funny things in sub arg specifications like `sub myfunc ($$)'
and `sub ($)'
("\\<sub\\(?:\\s-+\\S-+\\)?\\s-*(\\([^)]+\\))" 1 '(1))
instead of the existing regexp.
Here's a patch.
--- emacs/22.1/lisp/progmodes/perl-mode.el~ 2008-03-28
17:19:19.267639000 +0000
+++ emacs/22.1/lisp/progmodes/perl-mode.el 2008-03-28
17:32:15.510903000 +0000
@@ -265,7 +265,7 @@
("\\$ ?{?^?[_a-zA-Z][_a-zA-Z0-9]*\\('\\)[_a-zA-Z]" (1 "_"))
;; format statements
("^[ \t]*format.*=[ \t]*\\(\n\\)" (1 '(7)))
- ;; Funny things in sub arg specifications like `sub myfunc ($$)'
+ ;; Funny things in sub arg specifications like `sub myfunc ($$)'
and `sub ($)'
("\\<sub\\(?:\\s-+\\S-+\\)?\\s-*(\\([^)]+\\))" 1 '(1))
;; regexp and funny quotes
("[?:.,;=!~({[][ \t\n]*\\(/\\)" (1 '(7)))
This was really annoying me! If you need a proper test case Perl file,
I can cook one up.
Regards,
Giuliano Procida.
next reply other threads:[~2008-03-28 17:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 17:37 Giuliano Procida [this message]
2008-03-29 8:43 ` perl-mode - fix syntax of anonymous sub prototypes Giuliano Procida
2008-03-29 14:58 ` Giuliano Procida
[not found] ` <mailman.9574.1206802710.18990.bug-gnu-emacs@gnu.org>
2008-03-29 15:39 ` Joost Diepenmaat
2008-04-03 22:10 ` Stefan Monnier
[not found] <mailman.9555.1206755263.18990.bug-gnu-emacs@gnu.org>
2008-03-29 11:23 ` Joost Diepenmaat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c8016cf0803281037q5c64bd21le5e3359ddadca955@mail.gmail.com \
--to=giuliano.procida@googlemail.com \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.