From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 26 05:32:18 2019 Received: (at submit) by debbugs.gnu.org; 26 Dec 2019 10:32:18 +0000 Received: from localhost ([127.0.0.1]:54946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikQRF-00027j-V5 for submit@debbugs.gnu.org; Thu, 26 Dec 2019 05:32:18 -0500 Received: from lists.gnu.org ([209.51.188.17]:45314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikQRD-00027b-6w for submit@debbugs.gnu.org; Thu, 26 Dec 2019 05:32:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37151) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikQRA-0003xF-NR for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 05:32:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_NONE, RECEIVED_FROM_WINDOWS_HOST,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ikQR8-000604-7x for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 05:32:11 -0500 Received: from mail-oln040092255035.outbound.protection.outlook.com ([40.92.255.35]:60384 helo=APC01-HK2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ikQR7-0005yA-25 for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 05:32:10 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MYeKFIWHE7ibo1IyuberwXwBn63MDqwXH59z6h8mh54mwCfp8Yy8uqmLzYUhCmCEYTl0PGKLHPSyR5x74eHDyxPw3pYs0/vPnymBEyz/DBAbIstGrYQWZ5hkGR/R9I9IutodU3BKTv4PCmrvwWLhTNRMIJhQg7fzruH+OAtWMgdO3KckF9mhVLhgZZ2Y69iXQiA5wyiMXKYaHsA21RUuYacNttsF3phiPxVneK3TqXZC9P5weJ0Gatnhr4TBgsPo0KrVa2d2K074j1+hDO8xUhtKv5h76ValhKlmykwg0yj/+Z+MRZHCwa2LX5/kE5FduInhWJozIG7vUG0WQSFmmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oZZNLQNHv0cpz8xZv0p2d1bNXdbcH/UzeB39VTAsZWM=; b=i09hGz/78tEre7uQFeUzZlbaDhmSMwU+YB0L8NA9RR4vrLAqx5Df6H8Tr97pQWosme6JhjC9DEt8F78DkQQ8TOsnTOfYbpM9TxQ0ZRXG4DIWDaHsyrRhN0F5PGzshLdPhD7186eUM1wMoC9d1jkORY+zE5j7NxbbVcXvO2eJfGREz7mKQ6lTxgmep+ezdLqXxXugNpxYanrQGmMG6Cdt38t54a7Mq3uwtu6vJzFRXqWwURWP4jCjcLX4aRuJ5E+VRcZ7lCZ1sdYeNZpJ7uDKmanwpypZuBmtyGOeMD8Nvr15ReykA3bz0bYc/c5OnXgurVwnlpEq8fYdcGULYA0DKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oZZNLQNHv0cpz8xZv0p2d1bNXdbcH/UzeB39VTAsZWM=; b=Eg0XgeLI8MlL6eJ5QqmKNdawvGph7sGFyJExS1mN9u0w5M2vksy7JUr2fLkrDVFPf0xqUdChsJ4QTy7rLA4q67WlKHjNU6ROkRCQEuEhZL66jSw3rvOnvc1tc+CEaIicy25VT1tBWsgxC43+m1xMaRs5BMTAhZ2wiv63dS7aN4LbWdivFP6r+NjOFwm4t3p2KI/XbTeU3bMoTaC5fZ1JBQekdiDt5+3LgTzXV7Xx3O9QcJk4OqYErn07oBWSrZB1L1pK8dISqofPpyxAfeQZfcYjYGBJA/zxOd2LYW/kXOcZMwDVGS1DWSn9gaF0ZTckJGQuxtgSSoSaOayFvxjWYg== Received: from PU1APC01FT010.eop-APC01.prod.protection.outlook.com (10.152.252.55) by PU1APC01HT238.eop-APC01.prod.protection.outlook.com (10.152.253.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.11; Thu, 26 Dec 2019 10:32:04 +0000 Received: from PS1PR03MB3606.apcprd03.prod.outlook.com (10.152.252.55) by PU1APC01FT010.mail.protection.outlook.com (10.152.252.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.11 via Frontend Transport; Thu, 26 Dec 2019 10:32:04 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:C3420107C3F1A2B154C42BFA4641C42BFE8671E2C24B24FC98DAE9879FEB76D2; UpperCasedChecksum:81E24EE23069D7195F65C3674CFCDB4F500269F1B2DADD13B5F59DA5C8219C1B; SizeAsReceived:8689; Count:46 Received: from PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b05a:28e4:205a:d7d4]) by PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b05a:28e4:205a:d7d4%5]) with mapi id 15.20.2581.007; Thu, 26 Dec 2019 10:32:04 +0000 Date: Thu, 26 Dec 2019 18:31:55 +0800 From: HaiJun Zhang To: =?utf-8?Q?Emanuel_Berg_via_Bug_reports_for_GNU_Emacs=2C_the_Swiss_army_knife_of_text_editors?= Message-ID: References: <66aa470b-7c40-4eeb-ba54-1af0adf1fc50@Spark> Subject: 27.0.50; objc-mode: wrong imenu item X-Readdle-Message-ID: db9375a8-9ed5-4059-90bc-c2d407f917e8@Spark Content-Type: multipart/alternative; boundary="5e048c21_23f9c13c_4379" X-ClientProxiedBy: HK2PR02CA0202.apcprd02.prod.outlook.com (2603:1096:201:20::14) To PS1PR03MB3606.apcprd03.prod.outlook.com (2603:1096:803:4e::17) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 Received: from [192.168.1.103] (1.196.186.247) by HK2PR02CA0202.apcprd02.prod.outlook.com (2603:1096:201:20::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.11 via Frontend Transport; Thu, 26 Dec 2019 10:32:03 +0000 X-Readdle-Message-ID: db9375a8-9ed5-4059-90bc-c2d407f917e8@Spark X-Microsoft-Original-Message-ID: X-TMN: [V0U+K/sFIfL04bb+r8DcywgGuVzybW3z] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: e194cbda-65b7-4fcd-14aa-08d789eed94c X-MS-TrafficTypeDiagnostic: PU1APC01HT238: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RSBLcKNp+We7FDCyfbVWUQd5jtJCFwie8OGRp2Kn045u6I0diR7wom0pf/Nrpwn+PrlN9zBmwMEi4Xd2kVX3WEBwiXT7ji8DSJPGJ04/dXZ8H/mkIuicpgP92on7rH5ZUyMlh+gmjhlmwbhCc/MxFYF2CZpVWyWT9Hiv0zM2KGUOAl7Gyp4FkcuObteCiP1F X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e194cbda-65b7-4fcd-14aa-08d789eed94c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2019 10:32:04.1425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1APC01HT238 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.255.35 X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --5e048c21_23f9c13c_4379 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline In GNU Emacs 27.0.50 (build 1, x86=5F64-apple-darwin17.7.0, NS appkit-156= 1.61 Version 10.13.6 (Build 17G10021)) =C2=A0of 2019-12-23 built on jundeMac Repository revision: 3ee8ee8476fef2a5e8159f7597e36e0953295ce2 Repository branch: mod Windowing system distributor =E2=80=98Apple', 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 inva= lid. =46or example, =E2=80=9CC/Copyright=E2=80=9D and some more are in the hea= der comment. Recent messages: =46or information about GNU Emacs and the GNU system, type C-h C-a. Quit Quit Configured using: =C2=A0=E2=80=98configure =E2=80=94with-ns '--enable-locallisppath=3D/Libr= ary/Application =C2=A0Support/Emacs/=24=7Bversion=7D/site-lisp:/Library/Application =C2=A0Support/Emacs/site-lisp=E2=80=99 --with-modules --disable-acl =C2=A0=E2=80=94without-makeinfo C=46LAGS=3D-O2=E2=80=99 Configured features: RSVG GLIB NOTI=46Y KQUEUE GNUTLS LIBXML2 ZLIB TOOLKIT=5FSCROLL=5FBARS NS MODULES THREADS PDUMPER LCMS2 GMP Important settings: =C2=A0 value of =24LANG: zh=5FCN.UT=46-8 =C2=A0 locale-coding-system: utf-8-unix Major mode: ObjC//l Minor modes in effect: =C2=A0 bug-reference-prog-mode: t =C2=A0 ido-everywhere: t =C2=A0 global-hl-line-mode: t =C2=A0 tooltip-mode: t =C2=A0 global-eldoc-mode: t =C2=A0 electric-indent-mode: t =C2=A0 mouse-wheel-mode: t =C2=A0 tool-bar-mode: t =C2=A0 menu-bar-mode: t =C2=A0 file-name-shadow-mode: t =C2=A0 global-font-lock-mode: t =C2=A0 font-lock-mode: t =C2=A0 blink-cursor-mode: t =C2=A0 auto-composition-mode: t =C2=A0 auto-encryption-mode: t =C2=A0 auto-compression-mode: t =C2=A0 line-number-mode: t =C2=A0 transient-mark-mode: t =C2=A0 abbrev-mode: t Load-path shadows: None found. =46eatures: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt imenu bug-reference cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs octave smie comint ansi-color ring package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars cl-loaddefs cl-lib windmove ido seq byte-opt gv bytecomp byte-compile cconv display-line-numbers hl-line china-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 92568 6733) =C2=A0(symbols 48 10865 0) =C2=A0(strings 32 31238 1963) =C2=A0(string-bytes 1 1102306) =C2=A0(vectors 16 18200) =C2=A0(vector-slots 8 265523 13352) =C2=A0(floats 8 31 33) =C2=A0(intervals 56 467 0) =C2=A0(buffers 1000 12)) --5e048c21_23f9c13c_4379 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
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 =E2=80=98Apple', version 10.3.1561
System Description: Mac OS X 10.13.6

Open file nsfns.m in emacs source(src/nsfns.m). Many imen= u items are invalid.
For example, =E2=80=9CC/Copyright=E2=80=9D and some more = are in the header comment.


Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Quit
Configured using:
 =E2=80=98configure =E2=80=94with-ns '--enable-locallisppath=3D/L= ibrary/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp=E2=80=99 --with-modules --disable-acl
 =E2=80=94without-makeinfo CFLAGS=3D-O2=E2=80=99

Configured features:
RSVG GLIB NOTIFY KQUEUE GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS
MODULES THREADS PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: zh_CN.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ObjC//l

Minor modes in effect:
  bug-reference-prog-mode: t
  ido-everywhere: t
  global-hl-line-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs<= /div>
format-spec rfc822 mml mml-sec epa derived epg epg-config gnus-util
rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodie= s
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail<= /div>
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt ime= nu
bug-reference cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs octave smie comint ansi-color ring<= /div>
package easymenu browse-url url-handlers url-parse auth-source cl-seq<= /div>
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map=
url-vars cl-loaddefs cl-lib windmove ido seq byte-opt gv bytecomp
byte-compile cconv display-line-numbers hl-line china-util tooltip eld= oc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-w= in
ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic<= /div>
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet la= o
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charpro= p
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa = ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 92568 6733)
 (symbols 48 10865 0)
 (strings 32 31238 1963)
 (string-bytes 1 1102306)
 (vectors 16 18200)
 (vector-slots 8 265523 13352)
 (floats 8 31 33)
 (intervals 56 467 0)
 (buffers 1000 12))

--5e048c21_23f9c13c_4379-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 06 13:08:05 2020 Received: (at 38749) by debbugs.gnu.org; 6 Jan 2020 18:08:05 +0000 Received: from localhost ([127.0.0.1]:46669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ioWnN-0001gO-IV for submit@debbugs.gnu.org; Mon, 06 Jan 2020 13:08:05 -0500 Received: from colin.muc.de ([193.149.48.1]:61533 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ioWnL-0001gE-Ej for 38749@debbugs.gnu.org; Mon, 06 Jan 2020 13:08:04 -0500 Received: (qmail 55609 invoked by uid 3782); 6 Jan 2020 18:08:01 -0000 Received: from acm.muc.de (p4FE15CA6.dip0.t-ipconnect.de [79.225.92.166]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 06 Jan 2020 19:08:00 +0100 Received: (qmail 9143 invoked by uid 1000); 6 Jan 2020 18:07:57 -0000 Date: Mon, 6 Jan 2020 18:07:57 +0000 To: HaiJun Zhang Subject: Re: bug#38749: 27.0.50; objc-mode: wrong imenu item Message-ID: <20200106180757.GA8917@ACM> References: <66aa470b-7c40-4eeb-ba54-1af0adf1fc50@Spark> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38749 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 C 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). From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 06 21:10:14 2020 Received: (at 38749) by debbugs.gnu.org; 7 Jan 2020 02:10:14 +0000 Received: from localhost ([127.0.0.1]:47089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ioeJx-0001dN-HG for submit@debbugs.gnu.org; Mon, 06 Jan 2020 21:10:13 -0500 Received: from mail-oln040092255080.outbound.protection.outlook.com ([40.92.255.80]:30594 helo=APC01-HK2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ioeJu-0001d1-CN for 38749@debbugs.gnu.org; Mon, 06 Jan 2020 21:10:12 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nBNYMPrwIbYeo5ZUaI0VykPTe6FVwKlM437bG6BLARF4vFLOl/SSaUuIdqUKtj+SqLXaGOevoKQI8vixrpq8NZhcUogOuDTtDdVZJR7o4snBLqrTXfZZn31bcXEPTuZnrp5RqIxGEBGoZP/DWjHhPMtXHsLX74jbSFPJ96mVwadEXhG13cmAWVIUa7W7sYmC2wvVuCSt4OtMxJLwfzDtvQiXyfEza6P2K8tPqGGdw25cXyyyc07qhCWrwt+QZ4ZaOwyykwkwi2gp0XyUAzfXsgkRa8vyim8q3Q6hp0yjS2ogKQZaSETRfl4dlqFN+BRw4Bv4nmVftHMSk0BKL32Jsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=htJf8xnmtpgGqvs1QcWETrjL3tYQI3rbJCgXXCVQBTo=; b=CyYGmieq2TQF1zYfsFru3rlmmQaFk84szKvT+Xpoq2c8y/0XuayVzRTipikmBrgWNDaO+92hHx/uiuNn6R/y9EAdq6L/gK3OQtOc/4vBLWL2QkDbgaFiS3nW1QlUWd3xjmo/uYa8S+X2boS6+XNKHkdo5p7nO+EbU36T7skTXVHppCdX1J4JxLvhgvQyY2xn2aS8H96xzKwlpLlvyPoilT0VncgIdd5lQYCp42NDMQjy07Ej1x3DHLdpUon4+SZPtkay2slBPSk/6A+cdsGPTzecNGC5boj9pO8EIs2ti5e5yl4MPWTOLRpUglOGVt592fd6IaYm7XTUHX0rECAoCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=htJf8xnmtpgGqvs1QcWETrjL3tYQI3rbJCgXXCVQBTo=; b=JVB6mB05rBCX/3C5eoOp7HKtUKYdcPj/qKokMvnde3uOBxJn2kFpnaXyg9OFtLuxsHPxivx5X2scR7S2R+YrPEvoM/3t6u1W538HvCclvEGMo+qtPaNzguQ3esGaXA+Uvo1Z+KslD9OgB4QMC53mO0s2yiRs0yz0yzpJkOvDSOoNfZGYxNdst8yuPqv9mlsJ9rNmNyoWsPjIoU9qK0ef658p0s1r2cTVewwd7W+Cv6yNEXQGWNhLulg4P2Tw2bpG3FqM2WzrIA5nI+V11S0pjO6IBFPqJY4H+bQYuKb0OZli0VMy3gk6rWWhyyZDrNbfC8W4lkKxRMYbB7ptLWlrtw== Received: from HK2APC01FT031.eop-APC01.prod.protection.outlook.com (10.152.248.55) by HK2APC01HT069.eop-APC01.prod.protection.outlook.com (10.152.249.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11; Tue, 7 Jan 2020 02:10:00 +0000 Received: from PS1PR03MB3606.apcprd03.prod.outlook.com (10.152.248.51) by HK2APC01FT031.mail.protection.outlook.com (10.152.248.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Tue, 7 Jan 2020 02:10:00 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A05957C9DD18F56B82AD36AE2E2EA748127CC5671BFE0D1C6067E7EADDEDCA27; UpperCasedChecksum:331549E0933498AE07EC387E72EA5645867975B40EB7CF2DF407FE0A73EA1BEF; SizeAsReceived:8933; Count:48 Received: from PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b470:80bc:efed:9117]) by PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b470:80bc:efed:9117%7]) with mapi id 15.20.2623.008; Tue, 7 Jan 2020 02:09:59 +0000 Date: Tue, 7 Jan 2020 10:09:49 +0800 From: HaiJun Zhang To: Alan Mackenzie Message-ID: In-Reply-To: <20200106180757.GA8917@ACM> References: <66aa470b-7c40-4eeb-ba54-1af0adf1fc50@Spark> <20200106180757.GA8917@ACM> Subject: Re: bug#38749: 27.0.50; objc-mode: wrong imenu item X-Readdle-Message-ID: 04acd9ae-5df1-486e-9fb4-1d11b1a02be2@Spark Content-Type: multipart/alternative; boundary="5e13e873_1f48eaa1_b145" X-ClientProxiedBy: HK2PR0302CA0013.apcprd03.prod.outlook.com (2603:1096:202::23) To PS1PR03MB3606.apcprd03.prod.outlook.com (2603:1096:803:4e::17) X-Microsoft-Original-Message-ID: <04acd9ae-5df1-486e-9fb4-1d11b1a02be2@Spark> MIME-Version: 1.0 Received: from [192.168.1.103] (1.196.184.176) by HK2PR0302CA0013.apcprd03.prod.outlook.com (2603:1096:202::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.4 via Frontend Transport; Tue, 7 Jan 2020 02:09:57 +0000 X-Readdle-Message-ID: 04acd9ae-5df1-486e-9fb4-1d11b1a02be2@Spark X-Microsoft-Original-Message-ID: <04acd9ae-5df1-486e-9fb4-1d11b1a02be2@Spark> X-TMN: [YeazECb+LSUtsEntVF8EYp0JsW2O74zD] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: c95625af-a94f-472d-c5f4-08d79316b2b0 X-MS-TrafficTypeDiagnostic: HK2APC01HT069: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NRhCsVJIP6tPdNa6IxWEF3Er3yXF6zHByJAgZNlFfNkwGAc0OWVP1qS6hdrdwYoOyiz6/XTvFQaJArb7IdP+h2nyE7CuDPFcZ3tYUYVjQP9GdP4AOZPe4z0api8Zb1PdeB2j5uqmKQIn7yX04x0NBZB6ixyN4YG+UXjMeTVZWAagG1zustncS5wwJ8by1i82 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c95625af-a94f-472d-c5f4-08d79316b2b0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2020 02:09:59.6005 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2APC01HT069 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38749 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --5e13e873_1f48eaa1_b145 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =E5=9C=A8 2020=E5=B9=B41=E6=9C=887=E6=97=A5 +0800 AM2:08=EF=BC=8CAlan Mac= kenzie =EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A > 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 s= o > long without detection. If I invoke imenu with a mouse click, it works.= > > Anyhow, with nsfns.m, do M-x imenu C and select any item. > This works. Now do M-x imenu. This throws the error =22Wrong type > argument: stringp, nil=22. > > I've fixed this now, but haven't committed the fix yet. > Thanks. > Back to your bug - clearly what is happening is that the regular > expression search for functions is finding things in comments (such as > =22Copyright (C)=22) 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=C2=BD year old Ryzen machine, scanni= ng > the freshly visited Objc buffer currently takes 0.0196s. With the check= > for comments/strings, it takes 0.0650s. > > That's a factor of =7E3.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.= > I'm not familiar with objc. What about searching the char '=7B' after the= current pattern=3F But then I see the following snippet in nsfns.m: static Lisp=5FObject interpret=5Fservices=5Fmenu (NSMenu *menu, Lisp=5FObject prefix, Lisp=5FO= bject old) /* =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94 =C2=A0 =C2=A0Turn the input menu (an NSMenu) into a lisp list for trackin= g on lisp side. =C2=A0 =C2=A0=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 */ =7B --5e13e873_1f48eaa1_b145 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
=E5=9C=A8 2020=E5=B9=B41=E6=9C=887=E6=97= =A5 +0800 AM2:08=EF=BC=8CAlan Mackenzie <acm@muc.de>=EF=BC=8C=E5= =86=99=E9=81=93=EF=BC=9A
I've just spent some t= ime 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.


Thanks.

Back to your bug - cle= arly 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 ea= sy
enough to fix, by checking for comments and strings, but comes with a
fairly stiff time penalty. On my 2=C2=BD 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.


I'm not familiar with objc. What about searching the char= '{' after the current pattern? But then I see the following snippet in nsf= ns.m:

static Lisp_Object
interpret_services_menu (NSMenu *menu, Lisp_Object prefix= , Lisp_Object old)
/* =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
   Turn the input menu (an NSMenu) into a lisp = list for tracking on lisp side.
   =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 */
{


--5e13e873_1f48eaa1_b145-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 07 15:54:03 2020 Received: (at 38749) by debbugs.gnu.org; 7 Jan 2020 20:54:03 +0000 Received: from localhost ([127.0.0.1]:49458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iovrX-0005RH-Ck for submit@debbugs.gnu.org; Tue, 07 Jan 2020 15:54:03 -0500 Received: from colin.muc.de ([193.149.48.1]:55901 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iovrV-0005Qq-Fg for 38749@debbugs.gnu.org; Tue, 07 Jan 2020 15:54:02 -0500 Received: (qmail 34308 invoked by uid 3782); 7 Jan 2020 20:53:59 -0000 Received: from acm.muc.de (p4FE15923.dip0.t-ipconnect.de [79.225.89.35]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 07 Jan 2020 21:53:57 +0100 Received: (qmail 21802 invoked by uid 1000); 7 Jan 2020 20:53:57 -0000 Date: Tue, 7 Jan 2020 20:53:57 +0000 To: HaiJun Zhang Subject: Re: bug#38749: 27.0.50; objc-mode: wrong imenu item Message-ID: <20200107205357.GA21795@ACM> References: <66aa470b-7c40-4eeb-ba54-1af0adf1fc50@Spark> <20200106180757.GA8917@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38749 Cc: 38749@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, HaiJun. On Tue, Jan 07, 2020 at 10:09:49 +0800, HaiJun Zhang wrote: > 在 2020年1月7日 +0800 AM2:08,Alan Mackenzie ,写道: > > 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 C 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. It turns out, that bug had been fixed in the Emacs core version of CC Mode back in 2012. ;-) > Thanks. > > 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. I tried the timings again this evening, and I no longer see this factor of ~3 slowdown. In fact just a few 10s of percent. So I've committed this fix, both to standalone CC Mode and the emacs-27 branch at savannah (from where it will soon find its way to the master branch). > I'm not familiar with objc. What about searching the char '{' after > the current pattern? But then I see the following snippet in nsfns.m: This isn't needed any more > static Lisp_Object > interpret_services_menu (NSMenu *menu, Lisp_Object prefix, Lisp_Object old) > /* ————————————————————————————————————— >    Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side. >    ————————————————————————————————————— */ > { Could I ask you to try out the new code, and if everything's OK, we can close the bug as fixed. Thanks! -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 07 23:03:55 2020 Received: (at 38749) by debbugs.gnu.org; 8 Jan 2020 04:03:55 +0000 Received: from localhost ([127.0.0.1]:49671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ip2ZX-0000iK-0T for submit@debbugs.gnu.org; Tue, 07 Jan 2020 23:03:55 -0500 Received: from mail-oln040092254080.outbound.protection.outlook.com ([40.92.254.80]:13136 helo=APC01-PU1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ip2ZT-0000i5-RB for 38749@debbugs.gnu.org; Tue, 07 Jan 2020 23:03:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fj1hAq8vZ/ZQTnfDnrgL6Fklf9ny+i11WxS8e76MioNPF3RmX7jXTW0T1eNgvtAGwIoPK6xzkXEiXOnJfsXCUdk6qWUFvpWMT5/DEjH6IA4kEbwSgxoKEzYJmDBqlattmPc2+JGVZBytS+vxVOJBoz77HV28tsnWJECGcwE/dDfGuZcYlX2fo3MUh7goVeCySDb3PilEWJTEIBduvARqOsQEdMB7/iu/REo1KqHw8BFR3g/IxYNkW7dtXCzsmxwDG5l5Da20BHpgBwy/2e+h8DVKasTPNWVQA4aOSr/r2o6RBjS6YKnKFsaNDy67nq1oDnO7Je2+Lp9tgNFc+P8Efg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fdcvrxjb2Lgql4nLRVTEWIevag9cymbVmQMIyskO7qU=; b=ecW8fbuyqD/g26M4uJeQRWVB79ga1m55K2vkH/fHtWXhWYaFYLi6cMgYLcRKpBI7rrBp+dxNd22LFUwQvtz6DkDOt06XFT1tqDiWTDuIxqgTW8KkBbZuQSDkenxceYt9CtghBhCpj/Ck22Zg+hhMWhHIMe1SA4y4S01NHxUojvZiyLFdFWvmDbzPkIm+GGjGOU2t6Kekas8KKiOy4Ks7dOZU6uWwtGTugB+5aIaP88f7mRwqIEEMdywl07F3Uo05HmSR1AtZbkqATOPTxvkO8/ssSyz8zUTRUQbTrk1ATteriFWqwUX/8a9IiA/XzvGpT2UUF7REyqgOAdek2pcloQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fdcvrxjb2Lgql4nLRVTEWIevag9cymbVmQMIyskO7qU=; b=BqClvwIss4K4HBJB/I9EQTvI6qhG0CnY9jPnxptiTqSKqsR05iO0sWXImuItrI/mATBTtKfYAbFtJHr8qo8McgNy00OkUVEQP2EOCJqchmD+3hhJ7YQcDg8KCwvX5MOX3DFWOH6+zfpahOzL+6r+8oHsi/60YK2DkXLXN0CoEMbF1dnbfQ65c9U2bNaL66FBLw0SSX0SexIhVYc5B7l/c5aWyxB5mwDdBIgkO6ZALZ0HPKy6dftlXQDQcFEKeiMT3PZ1XmSJYRKseKwfYubBa7MZS58lu3RKDhMl0c/l2F/Cq/0IhWqpJ0MsELZfOzlNgpzkHrZsdkFC4yxmFj1LPQ== Received: from HK2APC01FT035.eop-APC01.prod.protection.outlook.com (10.152.248.60) by HK2APC01HT081.eop-APC01.prod.protection.outlook.com (10.152.249.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11; Wed, 8 Jan 2020 04:03:43 +0000 Received: from PS1PR03MB3606.apcprd03.prod.outlook.com (10.152.248.54) by HK2APC01FT035.mail.protection.outlook.com (10.152.248.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Wed, 8 Jan 2020 04:03:43 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:4D5782629DEC4E9E1706E4C9BBBCE50D1235AA0EFC862233FE0438C2DD20441F; UpperCasedChecksum:05C193EAE0FF6BB78533A4A7B392B79D13AFD84AAFBA0E745A66F56AA6C80B4C; SizeAsReceived:8969; Count:48 Received: from PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b470:80bc:efed:9117]) by PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b470:80bc:efed:9117%7]) with mapi id 15.20.2623.008; Wed, 8 Jan 2020 04:03:43 +0000 Date: Wed, 8 Jan 2020 12:03:32 +0800 From: HaiJun Zhang To: Alan Mackenzie Message-ID: In-Reply-To: <20200107205357.GA21795@ACM> References: <66aa470b-7c40-4eeb-ba54-1af0adf1fc50@Spark> <20200106180757.GA8917@ACM> <20200107205357.GA21795@ACM> Subject: Re: bug#38749: 27.0.50; objc-mode: wrong imenu item X-Readdle-Message-ID: 2d2874d0-8799-4044-9341-5710f7ca90a4@Spark Content-Type: multipart/alternative; boundary="5e15549a_100f8fca_b145" X-ClientProxiedBy: HK2PR0401CA0012.apcprd04.prod.outlook.com (2603:1096:202:2::22) To PS1PR03MB3606.apcprd03.prod.outlook.com (2603:1096:803:4e::17) X-Microsoft-Original-Message-ID: <2d2874d0-8799-4044-9341-5710f7ca90a4@Spark> MIME-Version: 1.0 Received: from [192.168.1.103] (1.196.184.176) by HK2PR0401CA0012.apcprd04.prod.outlook.com (2603:1096:202:2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12 via Frontend Transport; Wed, 8 Jan 2020 04:03:42 +0000 X-Readdle-Message-ID: 2d2874d0-8799-4044-9341-5710f7ca90a4@Spark X-Microsoft-Original-Message-ID: <2d2874d0-8799-4044-9341-5710f7ca90a4@Spark> X-TMN: [br325SEQitGbzoJZE+zXL1/fF0fQfNsE] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 0fe8e7ff-dccb-48e4-4bf9-08d793efc079 X-MS-TrafficTypeDiagnostic: HK2APC01HT081: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FkaTaulXg1BEIiWAryrED09pX7XDJ2G4pIfSVQiME7j5jxPcNIJUsEzozQPWG5bp1LOzZS/fSKpEts1EgDmmIv0qR6Mp5iP/cPRtPvmi5IBdJC0OGXcSEFD/urXupHJ1kPUPco/arN/17ZsYFg9bSkBK5eEjLflQISXH9KqHu8KKAOEy4DeH28UIMs1sptXQ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fe8e7ff-dccb-48e4-4bf9-08d793efc079 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2020 04:03:43.5563 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2APC01HT081 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38749 Cc: 38749@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --5e15549a_100f8fca_b145 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I tried. It is fixed. Thanks. =E5=9C=A8 2020=E5=B9=B41=E6=9C=888=E6=97=A5 +0800 AM4:54=EF=BC=8CAlan Mac= kenzie =EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A > Hello, HaiJun. > > On Tue, Jan 07, 2020 at 10:09:49 +0800, HaiJun Zhang wrote: > > =E5=9C=A8 2020=E5=B9=B41=E6=9C=887=E6=97=A5 +0800 AM2:08=EF=BC=8CAlan= Mackenzie =EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A > > > 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 C and select any > > > item. This works. Now do M-x imenu. This throws the error =22Wrong > > > type argument: stringp, nil=22. > > > > I've fixed this now, but haven't committed the fix yet. > > It turns out, that bug had been fixed in the Emacs core version of CC > Mode back in 2012. ;-) > > > Thanks. > > > > Back to your bug - clearly what is happening is that the regular > > > expression search for functions is finding things in comments (such= as > > > =22Copyright (C)=22) 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=C2=BD year old Ryzen machine, sc= anning > > > the freshly visited Objc buffer currently takes 0.0196s. With the c= heck > > > for comments/strings, it takes 0.0650s. > > > > That's a factor of =7E3.25 slower. On a slower machine (factor 3) w= ith 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 lit= tle. > > I tried the timings again this evening, and I no longer see this factor= > of =7E3 slowdown. In fact just a few 10s of percent. > > So I've committed this fix, both to standalone CC Mode and the emacs-27= > branch at savannah (from where it will soon find its way to the master > branch). > > > I'm not familiar with objc. What about searching the char '=7B' after= > > the current pattern=3F But then I see the following snippet in nsfns.= m: > > This isn't needed any more > > > static Lisp=5FObject > > interpret=5Fservices=5Fmenu (NSMenu *menu, Lisp=5FObject prefix, Lisp= =5FObject old) > > /* =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 > > =C2=A0 =C2=A0Turn the input menu (an NSMenu) into a lisp list for tra= cking on lisp side. > > =C2=A0 =C2=A0=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 */ > > =7B > > Could I ask you to try out the new code, and if everything's OK, we can= > close the bug as fixed. > > Thanks=21 > > -- > Alan Mackenzie (Nuremberg, Germany). --5e15549a_100f8fca_b145 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I tried. It is fixed. Thanks.
=E5=9C=A8 2020=E5=B9=B41=E6=9C=888=E6=97= =A5 +0800 AM4:54=EF=BC=8CAlan Mackenzie <acm@muc.de>=EF=BC=8C=E5= =86=99=E9=81=93=EF=BC=9A
Hello, HaiJun.

On Tue, Jan 07, 2020 at 10:09:49 +0800, HaiJun Zhang wrote:
=E5=9C=A8 2020=E5=B9= =B41=E6=9C=887=E6=97=A5 +0800 AM2:08=EF=BC=8CAlan Mackenzie <acm@muc= .de>=EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A
I've just spent some t= ime 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, b= ut haven't committed the fix yet.

It turns out, that bug had been fixed in the Emacs core version of CC
Mode back in 2012. ;-)

Thanks.

Back to your bug - cle= arly 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 ea= sy
enough to fix, by checking for comments and strings, but comes with a
fairly stiff time penalty. On my 2=C2=BD 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.
=

I tried the timings again this evening, and I no longer see this factor
of ~3 slowdown. In fact just a few 10s of percent.

So I've committed this fix, both to standalone CC Mode and the emacs-27
branch at savannah (from where it will soon find its way to the master
branch).

I'm not familiar with = objc. What about searching the char '{' after
the current pattern? But then I see the following snippet in nsfns.m:

This isn't needed any more

static Lisp_Object
interpret_services_menu (NSMenu *menu, Lisp_Object prefix, Lisp_Object old)=
/* =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94
   Turn the input menu (an NSMenu) into a lisp list for tracking = on lisp side.
   =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 */
{

Could I ask you to try out the new code, and if everything's OK, we can
close the bug as fixed.

Thanks!

--
Alan Mackenzie (Nuremberg, Germany).
--5e15549a_100f8fca_b145-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 08 02:09:33 2020 Received: (at 38749-done) by debbugs.gnu.org; 8 Jan 2020 07:09:33 +0000 Received: from localhost ([127.0.0.1]:49707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ip5TB-0007SO-AL for submit@debbugs.gnu.org; Wed, 08 Jan 2020 02:09:33 -0500 Received: from colin.muc.de ([193.149.48.1]:43367 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ip5T7-0007SA-Dg for 38749-done@debbugs.gnu.org; Wed, 08 Jan 2020 02:09:32 -0500 Received: (qmail 18200 invoked by uid 3782); 8 Jan 2020 07:09:27 -0000 Received: from acm.muc.de (p4FE15B57.dip0.t-ipconnect.de [79.225.91.87]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 08 Jan 2020 08:09:25 +0100 Received: (qmail 4052 invoked by uid 1000); 8 Jan 2020 07:09:25 -0000 Date: Wed, 8 Jan 2020 07:09:25 +0000 To: HaiJun Zhang Subject: Re: bug#38749: 27.0.50; objc-mode: wrong imenu item Message-ID: <20200108070925.GA4007@ACM> References: <66aa470b-7c40-4eeb-ba54-1af0adf1fc50@Spark> <20200106180757.GA8917@ACM> <20200107205357.GA21795@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38749-done Cc: 38749-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, HaiJun. On Wed, Jan 08, 2020 at 12:03:32 +0800, HaiJun Zhang wrote: > I tried. It is fixed. Thanks. OK, Thanks! I'm closing the bug with this post. > 在 2020年1月8日 +0800 AM4:54,Alan Mackenzie ,写道: > > Hello, HaiJun. [ .... ] > > Could I ask you to try out the new code, and if everything's OK, we can > > close the bug as fixed. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sun Jun 22 04:02:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 05 Feb 2020 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator