From 085f5d7dcae1d423054ea0dd0c87382ee01cc6fa Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 8 May 2011 14:23:11 -0400 Subject: [PATCH] Handle "my" and "our" keywords in Perl imenu (Bug#8261). * progmodes/perl-mode.el (perl-imenu-generic-expression): Only match variables declared via `my' or `our'. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/perl-mode.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3df4ba354eb..3d2cb34730d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-05-08 Ralph Schleicher + + * progmodes/perl-mode.el (perl-imenu-generic-expression): Only + match variables declared via `my' or `our' (Bug#8261). + 2011-05-08 Chong Yidong * progmodes/grep.el (grep-mode-font-lock-keywords): Remove diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index ed628730fc1..8ca8c690f92 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -166,7 +166,7 @@ The expansion is entirely correct because it uses the C preprocessor." '(;; Functions (nil "^sub\\s-+\\([-A-Za-z0-9+_:]+\\)" 1) ;;Variables - ("Variables" "^\\([$@%][-A-Za-z0-9+_:]+\\)\\s-*=" 1) + ("Variables" "^\\(?:my\\|our\\)\\s-+\\([$@%][-A-Za-z0-9+_:]+\\)\\s-*=" 1) ("Packages" "^package\\s-+\\([-A-Za-z0-9+_:]+\\);" 1) ("Doc sections" "^=head[0-9][ \t]+\\(.*\\)" 1)) "Imenu generic expression for Perl mode. See `imenu-generic-expression'.")