unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 52319@debbugs.gnu.org
Cc: fatiparty@tutanota.com
Subject: bug#52319: imenu not detecting every bash function
Date: Sun, 05 Dec 2021 23:48:14 +0100	[thread overview]
Message-ID: <m1k0gieki9.fsf@yahoo.es> (raw)
In-Reply-To: <MqBaeNn--3-2@tutanota.com> (fatiparty's message of "Sun, 5 Dec 2021 22:58:06 +0100 (CET)")

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 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).





  reply	other threads:[~2021-12-05 22:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-05 21:58 bug#52319: imenu not detecting every bash function fatiparty--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-05 22:48 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-12-18 20:13   ` fatiparty--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <m1k0gieki9.fsf@yahoo.es-MqBmNpQ----2>
2021-12-08  7:29   ` fatiparty--- via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=m1k0gieki9.fsf@yahoo.es \
    --to=bug-gnu-emacs@gnu.org \
    --cc=52319@debbugs.gnu.org \
    --cc=fatiparty@tutanota.com \
    --cc=mardani29@yahoo.es \
    /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).