From: Alan Mackenzie <acm@muc.de>
To: HaiJun Zhang <netjune@outlook.com>
Cc: for@acm.muc.de, Bug@acm.muc.de, Emanuel@acm.muc.de,
Emacs@acm.muc.de, 38749@debbugs.gnu.org, reports@acm.muc.de,
GNU@acm.muc.de, Berg@acm.muc.de, via@acm.muc.de
Subject: bug#38749: 27.0.50; objc-mode: wrong imenu item
Date: Mon, 6 Jan 2020 18:07:57 +0000 [thread overview]
Message-ID: <20200106180757.GA8917@ACM> (raw)
In-Reply-To: <PS1PR03MB360650890FF27FCCAC8BF67EB72B0@PS1PR03MB3606.apcprd03.prod.outlook.com>
Hello, HaiJun.
On Thu, Dec 26, 2019 at 18:31:55 +0800, HaiJun Zhang wrote:
> In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.7.0, NS appkit-1561.61 Version 10.13.6 (Build 17G10021))
> of 2019-12-23 built on jundeMac
> Repository revision: 3ee8ee8476fef2a5e8159f7597e36e0953295ce2
> Repository branch: mod
> Windowing system distributor ‘Apple', version 10.3.1561
> System Description: Mac OS X 10.13.6
> Open file nsfns.m in emacs source(src/nsfns.m). Many imenu items are invalid.
> For example, “C/Copyright” and some more are in the header comment.
I've just spent some time fixing a more serious bug in the Objective-C
imenu mechanism. This only occurs when I invoke imenu through the
keyboard (e.g. with M-x imenu), which might explain why it's survived so
long without detection. If I invoke imenu with a mouse click, it works.
Anyhow, with nsfns.m, do M-x imenu <tab> C <tab> and select any item.
This works. Now do M-x imenu. This throws the error "Wrong type
argument: stringp, nil".
I've fixed this now, but haven't committed the fix yet.
Back to your bug - clearly what is happening is that the regular
expression search for functions is finding things in comments (such as
"Copyright (C)") which look like functions but aren't. This is easy
enough to fix, by checking for comments and strings, but comes with a
fairly stiff time penalty. On my 2½ year old Ryzen machine, scanning
the freshly visited Objc buffer currently takes 0.0196s. With the check
for comments/strings, it takes 0.0650s.
That's a factor of ~3.25 slower. On a slower machine (factor 3) with a
larger file (factor 3) this could mean the scanning would take 0.6s
rather than 0.2s. This might be slow enough to annoy somebody a little.
Getting spurious entries in the index, like "Copyright" also is clearly
annoying, otherwise you wouldn't have submitted the bug report. So
please give me a little time to decide which annoyance is the more
important. Sorry!
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2020-01-06 18:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <66aa470b-7c40-4eeb-ba54-1af0adf1fc50@Spark>
2019-12-26 10:31 ` bug#38749: 27.0.50; objc-mode: wrong imenu item HaiJun Zhang
2020-01-06 18:07 ` Alan Mackenzie [this message]
2020-01-07 2:09 ` HaiJun Zhang
2020-01-07 20:53 ` Alan Mackenzie
2020-01-08 4:03 ` HaiJun Zhang
2020-01-08 7:09 ` Alan Mackenzie
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200106180757.GA8917@ACM \
--to=acm@muc.de \
--cc=38749@debbugs.gnu.org \
--cc=Berg@acm.muc.de \
--cc=Bug@acm.muc.de \
--cc=Emacs@acm.muc.de \
--cc=Emanuel@acm.muc.de \
--cc=GNU@acm.muc.de \
--cc=for@acm.muc.de \
--cc=netjune@outlook.com \
--cc=reports@acm.muc.de \
--cc=via@acm.muc.de \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.