From: "Matthew Persico (BLOOMBERG/ 919 3RD A)" <mpersico5@bloomberg.net>
To: schwab@linux-m68k.org
Cc: stefan@marxist.se, 21477@debbugs.gnu.org
Subject: bug#21477: 24.4; Imenu - improper parse of shell function names
Date: Wed, 12 Aug 2020 15:57:12 -0000 [thread overview]
Message-ID: <5F34115800C706E600390513_0_42393@msllnjpmsgsv06> (raw)
In-Reply-To: <55F6D62E02050314003904F5_0_77779@p057>
[-- Attachment #1: Type: text/plain, Size: 1799 bytes --]
I asked on bug-bash:
The bash-20191127 snapshot updated the manpage documentation for a
function definition (to align with reality). It is now defined as:
function fname [()] compound-command [redirection]
and includes the description:
When in posix mode, fname must be a valid shell name and may not be the
name of one of the POSIX special builtins. In default mode, a function
name can be any unquoted shell word that does not contain $.
For context:
word - A sequence of characters considered as a single unit by the
shell. Also known as a token.
name - A word consisting only of alphanumeric characters and
underscores, and beginning with an alphabetic character or an
underscore. Also referred to as an identifier.
--
Eli Schwartz
Bug Wrangler and Trusted User
I guess you could go full-on and change the function name match pattern to be a "word" or just add the '-' to it for now to be safe.
From: schwab@linux-m68k.org At: 08/12/20 10:54:40To: Matthew Persico (BLOOMBERG/ 919 3RD A )
Cc: stefan@marxist.se, 21477@debbugs.gnu.org
Subject: Re: bug#21477: 24.4; Imenu - improper parse of shell function names
On Aug 12 2020, Matthew Persico (BLOOMBERG/ 919 3RD A) wrote:
> I can reproduce this behaviour, but is it really a bug? Aren't the
> names with '-' invalid?
It's a POSIX extension, enforced in POSIX mode:
13. Function names must be valid shell 'name's. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit. Declaring a function with an invalid
name causes a fatal syntax error in non-interactive shells.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
[-- Attachment #2: Type: text/html, Size: 3826 bytes --]
next prev parent reply other threads:[~2020-08-12 15:57 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)
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) [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5F34115800C706E600390513_0_42393@msllnjpmsgsv06 \
--to=mpersico5@bloomberg.net \
--cc=21477@debbugs.gnu.org \
--cc=schwab@linux-m68k.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).