GNU bug report logs - #21477
24.4; Imenu - improper parse of shell function names

Previous Next

Package: emacs;

Reported by: Matthew Persico <mpersico5 <at> bloomberg.net>

Date: Mon, 14 Sep 2015 15:29:02 UTC

Severity: normal

Merged with 52319, 52928, 54265, 56003, 57255, 58554

Found in version 24.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 21477 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: "Matthew Persico (BLOOMBERG/ 731 LEX)" <mpersico5 <at> bloomberg.net>
Cc: 21477 <at> debbugs.gnu.org
Subject: Re: bug#21477: 24.4; Imenu - improper parse of shell function names
Date: Tue, 11 Aug 2020 21:15:38 -0700
tags 21477 + moreinfo
thanks

"Matthew Persico (BLOOMBERG/ 731 LEX)" <mpersico5 <at> bloomberg.net> writes:

> 1) Create a file with this text:
> # -*- sh -*-
> this_is_parsed ()
> {
> echo 1
> }
>
> function this_is_also_parsed
> {
> echo 1
> }
>
> this-is-not-parsed ()
> {
> echo 1
> }
>
> function this-is-also-not-parsed
> {
> echo 1
> }
>
> 2) Load it into emacs that has imenu.
>
> 3) Look for functions in the imenu list. Only the ones with '_' show up. The ones with '-' do not.

I can reproduce this behaviour, but is it really a bug?  Aren't the
names with '-' invalid?

The Bash Reference Manual says:

name

    A word consisting solely of letters, numbers, and underscores, and
    beginning with a letter or underscore. Names are used as shell
    variable and function names. Also referred to as an identifier.

https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html

Best regards,
Stefan Kangas




This bug report was last modified 224 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.