unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Ergus <spacibba@aol.com>
Cc: 36678@debbugs.gnu.org
Subject: bug#36678: 27.0.50; imenu not working in C++ (maybe because of namespace)
Date: 17 Jul 2019 16:34:27 -0000	[thread overview]
Message-ID: <20190717163427.18177.qmail@mail.muc.de> (raw)
In-Reply-To: <mailman.1463.1563222851.2688.bug-gnu-emacs@gnu.org>

Hello again, Ergus.

In article <mailman.1463.1563222851.2688.bug-gnu-emacs@gnu.org> you wrote:
> [-- text/plain, encoding 7bit, charset: us-ascii, 91 lines --]

> --text follows this line--

> In the example code (attachement) imenu does not recognizes the
> functions. So it shows that there are not candidates when there are.

[ .... ]

> Major mode: C++//l

The problem is that the function names are not at column zero.  If they
were, they'd get recognised properly.  If CC Mode's imenu were to
recognise indented functions there'd be too many false positives.

This problem has actually come up before (on 2016-11-25, in a post to the
CC Mode list by Jens Kjerrström), and I then hacked up three defuns which
would search for functions functionally rather than by regexp.  This
wasn't wholly satisfactory since (i) this searching was slow; and (ii) if
there were two functions of the same name (e.g., in different
namespaces), imenu would only find the first one in the buffer.

If you are interested, I could send you this hack, which is not all that
big.  Maybe you could play around with it and make it work well.

Maybe it would be possible to bring this approach up to a usable part of
CC Mode - possibly solving (ii) by constructing a hierarchical menu, but
problem (i) would remain.  In any case this would be a substantial
enhancement rather than a simple bug fix.

[ .... ]

> [-- text/plain, encoding 7bit, charset: us-ascii, 45 lines, name: make_local_matrix.hpp --]

> #ifndef _make_local_matrix_hpp_
> #define _make_local_matrix_hpp_

> #include <vector>
> #include <map>

> #include <cassert>
> #include <cstdio>

> #include <fstream>


> namespace miniFE {


>         void get_recv_info_task(CSRMatrix *A, size_t id, size_t numboxes
>                                 const size_t *nrows_array,
>                                 size_t Annz, size_t Anrows)
>         {

>         }


>         void get_send_info_task(CSRMatrix *A, size_t id,
>                 size_t numboxes,
>                 int *send_length_local)
>         {
>         }


>         void set_send_info_task(CSRMatrix *A_array, size_t id,
>                                 size_t numboxes,
>                                 int nelements_to_send_local,
>                                 int *elements_to_send_local)
>         {
>         }

>         void make_local_matrix(CSRMatrix *A_array, singleton *sing, size_t numboxes)
>         {
>         }

> }//namespace miniFE

> #endif

-- 
Alan Mackenzie (Nuremberg, Germany).






  parent reply	other threads:[~2019-07-17 16:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 20:33 bug#36678: 27.0.50; imenu not working in C++ (maybe because of namespace) Ergus
     [not found] ` <mailman.1463.1563222851.2688.bug-gnu-emacs@gnu.org>
2019-07-17 14:39   ` Alan Mackenzie
2019-07-17 16:34   ` Alan Mackenzie [this message]
2019-07-31 15:56     ` Ergus
2019-08-02 19:33       ` Alan Mackenzie
     [not found]       ` <20190802193315.GC11966@ACM>
2019-08-02 19:56         ` Paul Smith
2019-08-03  2:25           ` Richard Stallman
2019-08-03 11:27           ` Alan Mackenzie
2019-08-03 15:09             ` Paul Smith
2019-08-04  3:01               ` Richard Stallman
2019-08-04 13:56                 ` Paul Smith
2019-08-05  2:25                   ` Richard Stallman
2019-08-04  2:56             ` Richard Stallman
2019-08-04  8:51               ` Alan Mackenzie
2019-08-05  2:26                 ` Richard Stallman
     [not found]           ` <E1htjjb-0002eO-Fo@fencepost.gnu.org>
2019-08-03  7:20             ` Eli Zaretskii
2019-08-03 14:43             ` Paul Smith
2019-08-05  2:24               ` Richard Stallman

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=20190717163427.18177.qmail@mail.muc.de \
    --to=acm@muc.de \
    --cc=36678@debbugs.gnu.org \
    --cc=spacibba@aol.com \
    /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).