From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: fatiparty--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#52319: imenu not detecting every bash function Date: Wed, 8 Dec 2021 08:29:36 +0100 (CET) Message-ID: References: Reply-To: fatiparty@tutanota.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_253884_2030584612.1638948576940" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21836"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52319@debbugs.gnu.org To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 08 10:28:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mutFJ-0005To-Pk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Dec 2021 10:28:18 +0100 Original-Received: from localhost ([::1]:54928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mutFI-000448-IQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Dec 2021 04:28:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mutF7-00043o-3E for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2021 04:28:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mutF4-0007Ru-3T for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2021 04:28:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mutF4-0003K4-0m for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2021 04:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: fatiparty@tutanota.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Dec 2021 09:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52319 X-GNU-PR-Package: emacs Original-Received: via spool by 52319-submit@debbugs.gnu.org id=B52319.163895564612722 (code B ref 52319); Wed, 08 Dec 2021 09:28:01 +0000 Original-Received: (at 52319) by debbugs.gnu.org; 8 Dec 2021 09:27:26 +0000 Original-Received: from localhost ([127.0.0.1]:39549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mutEM-0003Iz-I0 for submit@debbugs.gnu.org; Wed, 08 Dec 2021 04:27:26 -0500 Original-Received: from w1.tutanota.de ([81.3.6.162]:60026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1murOb-0000To-8Z for 52319@debbugs.gnu.org; Wed, 08 Dec 2021 02:29:48 -0500 Original-Received: from w3.tutanota.de (unknown [192.168.1.164]) by w1.tutanota.de (Postfix) with ESMTP id E97B8FBF613; Wed, 8 Dec 2021 07:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1638948576; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=+pcseve/nKGJsPvvrdayOGOSJImzuDgvBacLYhFKr+I=; b=RJUutUqs2s5pL7gDCTjyRnoOEt5S3zct03hOc/URcY7IMbHgISiurxhtrX55kSsL R4zhAIbcmSsELx3vU1p3OGFh5h28GUf18sm0wLUXnr+A/wAFmhbOI3CvlIY/WNy5sTh 2APbuAX55h2ovmD8OUmkjwcjF0YmCzodayY7s4v0Sc+ZcHek38lEmRPtau64S/U2SKD c4erEA3BFyeQb1iYn76pxYxYAc0yl//QwxqhDuQQh+V15tDCito9nY7cGG8CTv7OnB2 lT6MMIHxCon8qCKNPtE8Tt0wz3nCHCwAgvv238dkt3dJBklCE81U7J2JZn6iBq3jhzP PRDhG8WeWQ== In-Reply-To: X-Mailman-Approved-At: Wed, 08 Dec 2021 04:27:18 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221913 Archived-At: ------=_Part_253884_2030584612.1638948576940 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dec 5, 2021, 22:48 by bug-gnu-emacs@gnu.org: > fatiparty--- via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" 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.=C2=A0 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 th= e speedbar. Currently this is slowing me down when going through the code base. ------=_Part_253884_2030584612.1638948576940 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dec 5, 2021, 22:48 by bug-gnu-emacs@gnu.org:
fatiparty--- via "Bug reports for GNU Emacs,= the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.= org> writes:
I am loading the attached bash fi= le but imenu is not showing all the
declared bash functions i= n 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 l= ies 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 characte= rs or an
underscore; support for hyphens could be a Bash exte= nsion.

One way to fix the issue could be to ex= tend the
sh-imenu-generic-expression alist in sh-script.el wi= th 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 se= e all supported bash function names in the speedbar.
Currently this is slowing me down when going through the code base.


------=_Part_253884_2030584612.1638948576940--