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: Sat, 18 Dec 2021 21:13:34 +0100 (CET) Message-ID: References: Reply-To: fatiparty@tutanota.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_75073_622118904.1639858414960" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17362"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52319 <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 Sat Dec 18 23:41:13 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 1myiO9-0004Mv-2A for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Dec 2021 23:41:13 +0100 Original-Received: from localhost ([::1]:59476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myiO7-00032Z-N6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Dec 2021 17:41:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myiNy-00032R-Tl for bug-gnu-emacs@gnu.org; Sat, 18 Dec 2021 17:41:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myiNy-0008G2-Lp for bug-gnu-emacs@gnu.org; Sat, 18 Dec 2021 17:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1myiNy-0001K5-Jz for bug-gnu-emacs@gnu.org; Sat, 18 Dec 2021 17:41: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: Sat, 18 Dec 2021 22:41:02 +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.16398672595057 (code B ref 52319); Sat, 18 Dec 2021 22:41:02 +0000 Original-Received: (at 52319) by debbugs.gnu.org; 18 Dec 2021 22:40:59 +0000 Original-Received: from localhost ([127.0.0.1]:44370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myiNv-0001JU-1y for submit@debbugs.gnu.org; Sat, 18 Dec 2021 17:40:59 -0500 Original-Received: from w1.tutanota.de ([81.3.6.162]:41766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myg5N-0001PM-6q for 52319@debbugs.gnu.org; Sat, 18 Dec 2021 15:13:41 -0500 Original-Received: from w3.tutanota.de (unknown [192.168.1.164]) by w1.tutanota.de (Postfix) with ESMTP id EDA68FA04A8; Sat, 18 Dec 2021 20:13:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1639858414; 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=HNgjSl8ZsxXU5ixLL1z39EYwvHMCf7TKAlFlqD6sXwI=; b=2w+FbD7e0BaekePVsGxAC4GdakD6932xaLPLlYy3YBZdtAE6jDBdHcoAe4Klv40d oLnACyJktx9vu+dcC2HQPsUNOwVw5MaeQgCpGvC63xYIR0lhqKyPpI0mbas1rTLGunx A4rtYPSRDgwqDmv8t8P60btvqpuGN4uq41Ya/TwzOypJovUqsR9c6dfVWt933K0Bjuz kNj9l1JQbWTIZJIDNafTKlQGR1Xcxm1auWgnfFn5im6KB+VKmZdo+o/qKQAL2r1WGfU zFKjRZoQVPB+dcUmbTPYbgnlgW0ml0g0yXE9kagj3cgkebl4F7KQhL86/mFM88ORa0E BWItlTv9vw== In-Reply-To: X-Mailman-Approved-At: Sat, 18 Dec 2021 17:40:57 -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:222626 Archived-At: ------=_Part_75073_622118904.1639858414960 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable No updates on this yet? Dec 6, 2021, 10:48 by mardani29@yahoo.es: > 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). > ------=_Part_75073_622118904.1639858414960 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

No updates on this yet?


Dec 6, 2021, 10:48 by mardani29@yahoo.es:
fatiparty--- via "Bug re= ports for GNU Emacs, the Swiss army knife of
text editors" &l= t;bug-gnu-emacs@gnu.org> writes:
I am loading = the attached bash file but imenu is not showing all the
decla= red 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 atta= ched.

Fati

The problem lies in that some of the functions have a hyphen in thei= r
name (for example "linge-newline ()"). Something like "lin= ge_newline
()" should be detected correctly. If I'm not mist= aken, POSIX requires
that shell function names only contain a= lphanumeric 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 alis= t in sh-script.el with a specific regexp
for bash that accoun= ts for hyphens (and any other character that Bash
may support= in function names).

------=_Part_75073_622118904.1639858414960--