GNU bug report logs - #52319
imenu not detecting every bash function

Previous Next

Package: emacs;

Reported by: fatiparty <at> tutanota.com

Date: Sun, 5 Dec 2021 22:03:02 UTC

Severity: normal

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

Found in version 24.4

To reply to this bug, email your comments to 52319 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52319; Package emacs. (Sun, 05 Dec 2021 22:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to fatiparty <at> tutanota.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 05 Dec 2021 22:03:03 GMT) Full text and rfc822 format available.

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

From: fatiparty <at> tutanota.com
To: bug-gnu-emacs <at> gnu.org
Subject: imenu not detecting every bash function
Date: Sun, 5 Dec 2021 22:58:06 +0100 (CET)
[Message part 1 (text/plain, inline)]
I am loading the attached bash file but imenu is not showing all the declared bash functions in the file, it only shows PF(), PFB(), PF2(), and pfm.  This has also the consequence of not displaying all functions in speedbar.

File is attached.

Fati
[Message part 2 (text/html, inline)]
[linge-copy.sh (application/x-shellscript, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52319; Package emacs. (Sun, 05 Dec 2021 22:49:01 GMT) Full text and rfc822 format available.

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

From: Daniel Martín <mardani29 <at> yahoo.es>
To: 52319 <at> debbugs.gnu.org
Cc: fatiparty <at> tutanota.com
Subject: Re: bug#52319: imenu not detecting every bash function
Date: Sun, 05 Dec 2021 23:48:14 +0100
fatiparty--- via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> I am loading the attached bash file but imenu is not showing all the
> declared bash functions in the file, it only shows PF(), PFB(), PF2(),
> and pfm.  This has also the consequence of not displaying all
> functions in speedbar.
>
> File is attached.
>
> Fati

The problem lies in that some of the functions have a hyphen in their
name (for example "linge-newline ()").  Something like "linge_newline
()" should be detected correctly.  If I'm not mistaken, POSIX requires
that shell function names only contain alphanumeric characters or an
underscore; support for hyphens could be a Bash extension.

One way to fix the issue could be to extend the
sh-imenu-generic-expression alist in sh-script.el with a specific regexp
for bash that accounts for hyphens (and any other character that Bash
may support in function names).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52319; Package emacs. (Wed, 08 Dec 2021 09:28:01 GMT) Full text and rfc822 format available.

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

From: fatiparty <at> tutanota.com
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 52319 <at> debbugs.gnu.org
Subject: bug#52319: imenu not detecting every bash function
Date: Wed, 8 Dec 2021 08:29:36 +0100 (CET)
[Message part 1 (text/plain, inline)]
Dec 5, 2021, 22:48 by bug-gnu-emacs <at> gnu.org:

> fatiparty--- via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> I am loading the attached bash file but imenu is not showing all the
>> declared bash functions in the file, it only shows PF(), PFB(), PF2(),
>> and pfm.  This has also the consequence of not displaying all
>> functions in speedbar.
>>
>> File is attached.
>>
>> Fati
>>
>
> The problem lies in that some of the functions have a hyphen in their
> name (for example "linge-newline ()").  Something like "linge_newline
> ()" should be detected correctly.  If I'm not mistaken, POSIX requires
> that shell function names only contain alphanumeric characters or an
> underscore; support for hyphens could be a Bash extension.
>
> One way to fix the issue could be to extend the
> sh-imenu-generic-expression alist in sh-script.el with a specific regexp
> for bash that accounts for hyphens (and any other character that Bash
> may support in function names).
>
It would help me a lot if I can see all supported bash function names in the speedbar.
Currently this is slowing me down when going through the code base.


[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52319; Package emacs. (Sat, 18 Dec 2021 22:41:02 GMT) Full text and rfc822 format available.

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

From: fatiparty <at> tutanota.com
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 52319 <52319 <at> debbugs.gnu.org>
Subject: bug#52319: imenu not detecting every bash function
Date: Sat, 18 Dec 2021 21:13:34 +0100 (CET)
[Message part 1 (text/plain, inline)]
No updates on this yet?



Dec 6, 2021, 10:48 by mardani29 <at> yahoo.es:

> fatiparty--- via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> I am loading the attached bash file but imenu is not showing all the
>> declared bash functions in the file, it only shows PF(), PFB(), PF2(),
>> and pfm.  This has also the consequence of not displaying all
>> functions in speedbar.
>>
>> File is attached.
>>
>> Fati
>>
>
> The problem lies in that some of the functions have a hyphen in their
> name (for example "linge-newline ()").  Something like "linge_newline
> ()" should be detected correctly.  If I'm not mistaken, POSIX requires
> that shell function names only contain alphanumeric characters or an
> underscore; support for hyphens could be a Bash extension.
>
> One way to fix the issue could be to extend the
> sh-imenu-generic-expression alist in sh-script.el with a specific regexp
> for bash that accounts for hyphens (and any other character that Bash
> may support in function names).
>

[Message part 2 (text/html, inline)]

Merged 52319 52928. Request was from Glenn Morris <rgm <at> fencepost.gnu.org> to control <at> debbugs.gnu.org. (Sat, 01 Jan 2022 20:38:01 GMT) Full text and rfc822 format available.

Forcibly Merged 21477 52319 52928. Request was from Glenn Morris <rgm <at> fencepost.gnu.org> to control <at> debbugs.gnu.org. (Wed, 12 Jan 2022 02:09:01 GMT) Full text and rfc822 format available.

Forcibly Merged 21477 52319 52928 54265. Request was from Glenn Morris <rgm <at> fencepost.gnu.org> to control <at> debbugs.gnu.org. (Sat, 05 Mar 2022 18:07:02 GMT) Full text and rfc822 format available.

Forcibly Merged 21477 52319 52928 54265 56003. Request was from Glenn Morris <rgm <at> fencepost.gnu.org> to control <at> debbugs.gnu.org. (Thu, 16 Jun 2022 00:45:02 GMT) Full text and rfc822 format available.

Forcibly Merged 21477 52319 52928 54265 56003 57255. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 17 Aug 2022 11:15:02 GMT) Full text and rfc822 format available.

Forcibly Merged 21477 52319 52928 54265 56003 57255 58554. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 16 Oct 2022 04:14:03 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 191 days ago.

Previous Next


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