From: "Matthew Persico (BLOOMBERG/ 919 3RD A)" <mpersico5@bloomberg.net>
To: stefan@marxist.se
Cc: 21477@debbugs.gnu.org
Subject: bug#21477: 24.4; Imenu - improper parse of shell function names
Date: Wed, 12 Aug 2020 13:51:44 -0000 [thread overview]
Message-ID: <5F33F3F000D2020C00390369_0_31281@msllnjpmsgsv06> (raw)
In-Reply-To: <55F6D62E02050314003904F5_0_77779@p057>
[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]
Interesting. I have function names with dashes all over and nothing complains. Not Bash 4.X, not shellcheck. If you ran that file in the post, it would not complain.
Now, you can't use dashes in variables. But functions work just fine.
I wonder if the bash manual needs an update?
From: stefan@marxist.se At: 08/12/20 00:15:40To: Matthew Persico (BLOOMBERG/ 919 3RD A )
Cc: 21477@debbugs.gnu.org
Subject: Re: bug#21477: 24.4; Imenu - improper parse of shell function names
tags 21477 + moreinfo
thanks
"Matthew Persico (BLOOMBERG/ 731 LEX)" <mpersico5@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
[-- Attachment #2: Type: text/html, Size: 3223 bytes --]
next prev parent reply other threads:[~2020-08-12 13:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 14:14 bug#21477: 24.4; Imenu - improper parse of shell function names Matthew Persico (BLOOMBERG/ 731 LEX)
2020-08-12 4:15 ` Stefan Kangas
2020-08-12 13:51 ` Matthew Persico (BLOOMBERG/ 919 3RD A) [this message]
2020-08-12 14:08 ` Stefan Kangas
2020-08-12 14:54 ` Andreas Schwab
2020-08-12 15:59 ` Stefan Kangas
2020-08-12 14:36 ` Matthew Persico (BLOOMBERG/ 919 3RD A)
2020-08-12 15:59 ` Stefan Kangas
2020-08-12 15:57 ` Matthew Persico (BLOOMBERG/ 919 3RD A)
2020-08-20 18:13 ` Matthew Persico (BLOOMBERG/ 919 3RD A)
2020-08-20 18:41 ` Stefan Kangas
2020-08-20 18:42 ` Matthew Persico (BLOOMBERG/ 919 3RD A)
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=5F33F3F000D2020C00390369_0_31281@msllnjpmsgsv06 \
--to=mpersico5@bloomberg.net \
--cc=21477@debbugs.gnu.org \
--cc=stefan@marxist.se \
/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.