From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#39972: 28.0.50; which-function no longer returning current Java method in Emacs 27 Date: Thu, 21 May 2020 17:42:11 +0000 Message-ID: <20200521174211.GA12036@ACM> References: <20200308113302.43082.qmail@mail.muc.de> <20200520191303.GA19762@ACM> <835zcp5knl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="89315"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39972@debbugs.gnu.org, Philipp Stephani To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 21 19:43:09 2020 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 1jbpDp-000N8B-QE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 May 2020 19:43:09 +0200 Original-Received: from localhost ([::1]:54904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbpDo-0006Rh-Iu for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 May 2020 13:43:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbpDi-0006RR-P1 for bug-gnu-emacs@gnu.org; Thu, 21 May 2020 13:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbpDi-0001XB-GK for bug-gnu-emacs@gnu.org; Thu, 21 May 2020 13:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jbpDi-0002Py-Dm for bug-gnu-emacs@gnu.org; Thu, 21 May 2020 13:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 May 2020 17:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39972 X-GNU-PR-Package: emacs Original-Received: via spool by 39972-submit@debbugs.gnu.org id=B39972.15900829369241 (code B ref 39972); Thu, 21 May 2020 17:43:02 +0000 Original-Received: (at 39972) by debbugs.gnu.org; 21 May 2020 17:42:16 +0000 Original-Received: from localhost ([127.0.0.1]:57244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbpCx-0002Oz-UI for submit@debbugs.gnu.org; Thu, 21 May 2020 13:42:16 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:13352 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jbpCv-0002Op-Rc for 39972@debbugs.gnu.org; Thu, 21 May 2020 13:42:14 -0400 Original-Received: (qmail 60852 invoked by uid 3782); 21 May 2020 17:42:12 -0000 Original-Received: from acm.muc.de (p4fe15b01.dip0.t-ipconnect.de [79.225.91.1]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Thu, 21 May 2020 19:42:11 +0200 Original-Received: (qmail 32186 invoked by uid 1000); 21 May 2020 17:42:11 -0000 Content-Disposition: inline In-Reply-To: <835zcp5knl.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:180711 Archived-At: Hello, Eli. On Thu, May 21, 2020 at 19:15:42 +0300, Eli Zaretskii wrote: > > From: Philipp Stephani > > Date: Thu, 21 May 2020 17:56:16 +0200 > > Cc: 39972@debbugs.gnu.org > > Do you think you could push these patches onto the release branch, as > > this appears to be a regression? > The fixes (especially the one for which-func) are too risky for the > release branch. Is it possible to come up with something simpler for > emacs-27? See below. > What change(s) caused the regression, exactly? class Foo { void bar() { // body <============== Point is here. } } Traditionally, the function which-function (in which-func.el) has tried a row of methods to find the current function, stopping after finding the first non-null result. Emacs 26's CC Mode's value of add-log-current-defun returned nil, after which which-function tried querying the imenu structures, which worked OK. emacs-27's CC Mode's value of add-log-current-defun now returns the top level function, "class Foo". which-function no longers proceeds to the imenu stuff. "class Foo" is here the result returned by which-function. This is not OK. master's CC Mode's value of add-log-current-defun now returns "bar". The remainder of the recent patch to which-function ensures that if add-log-current-defun IS ACTUALLY CALLED and returns nil, this nil becomes which-function's result. There were previously problems where add-log-current-defun had returned nil because point was outside any function, yet imenu would later return a spurious function name. > Is it possible to come up with something simpler for emacs-27? I think the change (in master) to CC Mode's value of add-log-current-defun could be put into emacs-27 on its own. This should be safe. The patch which made this change (bug #39972) was: 5989432d15feb4439e759d2c0e28233ca22a7604 "CC Mode: Fix bug #39972, by fixing c-display-defun-name for nested defuns" Date: Wed May 20 19:02:26 2020 +0000. What do you say to putting this into emacs-27? -- Alan Mackenzie (Nuremberg, Germany).