* bug#8261: Perl mode imenu index ignores my/our variables
@ 2011-03-15 20:34 Ralph Schleicher
2011-05-08 18:25 ` Chong Yidong
0 siblings, 1 reply; 2+ messages in thread
From: Ralph Schleicher @ 2011-03-15 20:34 UTC (permalink / raw
To: 8261
Hi,
in Perl mode the imenu index does not list variables declared via 'my'
and 'our'. Below is a patch together with a change log entry to fix it.
Please note that the regular expression is "\\(?:my\\|our\\))\\s-+" and
not "\\(?:\\(?:my\\|our\\))\\s-+\\)?" (optional match). Not declaring
global variables properly is generally considered bad Perl style.
2011-03-11 Ralph Schleicher <rs@ralph-schleicher.de>
* progmodes/perl-mode.el (perl-imenu-generic-expression): Only
match variables declared via `my' or `our'.
--- emacs-23.3/lisp/progmodes/perl-mode.el.orig 2011-01-08 12:45:14 +0100
+++ emacs-23.3/lisp/progmodes/perl-mode.el 2011-03-11 11:39:42 +0100
@@ -167,7 +167,7 @@
'(;; 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'.")
--
Ralph
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#8261: Perl mode imenu index ignores my/our variables
2011-03-15 20:34 bug#8261: Perl mode imenu index ignores my/our variables Ralph Schleicher
@ 2011-05-08 18:25 ` Chong Yidong
0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2011-05-08 18:25 UTC (permalink / raw
To: Ralph Schleicher; +Cc: 8261
Ralph Schleicher <rs@ralph-schleicher.de> writes:
> in Perl mode the imenu index does not list variables declared via 'my'
> and 'our'. Below is a patch together with a change log entry to fix it.
> Please note that the regular expression is "\\(?:my\\|our\\))\\s-+" and
> not "\\(?:\\(?:my\\|our\\))\\s-+\\)?" (optional match). Not declaring
> global variables properly is generally considered bad Perl style.
Committed; thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-08 18:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15 20:34 bug#8261: Perl mode imenu index ignores my/our variables Ralph Schleicher
2011-05-08 18:25 ` Chong Yidong
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.