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: 8 Mar 2020 11:33:02 -0000 Organization: muc.de e.V. Message-ID: <20200308113302.43082.qmail@mail.muc.de> References: Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="118407"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (FreeBSD/11.3-RELEASE-p3 (amd64)) Cc: 39972@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 08 12:34:18 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 1jAuCI-000UiV-2i for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Mar 2020 12:34:18 +0100 Original-Received: from localhost ([::1]:57002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAuCG-0001kO-P0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Mar 2020 07:34:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41471) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAuC7-0001k9-Jn for bug-gnu-emacs@gnu.org; Sun, 08 Mar 2020 07:34:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAuC6-0007nU-Iu for bug-gnu-emacs@gnu.org; Sun, 08 Mar 2020 07:34:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAuC6-0007n0-G1 for bug-gnu-emacs@gnu.org; Sun, 08 Mar 2020 07:34:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jAuC2-0006W6-E6 for bug-gnu-emacs@gnu.org; Sun, 08 Mar 2020 07:34: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: Sun, 08 Mar 2020 11:34: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.158366718724968 (code B ref 39972); Sun, 08 Mar 2020 11:34:02 +0000 Original-Received: (at 39972) by debbugs.gnu.org; 8 Mar 2020 11:33:07 +0000 Original-Received: from localhost ([127.0.0.1]:47970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAuB8-0006Ue-Q1 for submit@debbugs.gnu.org; Sun, 08 Mar 2020 07:33:06 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:59945 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jAuB6-0006UU-Lh for 39972@debbugs.gnu.org; Sun, 08 Mar 2020 07:33:05 -0400 Original-Received: (qmail 43083 invoked by uid 3782); 8 Mar 2020 11:33:02 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:177049 Archived-At: Hello, Philipp. In article you wrote: > Assume there's a file /tmp/Foo.java: > $ cat /tmp/Foo.java > class Foo { > void bar() { > // body > } > } > Emacs 26: > $ emacs -Q -batch -l which-func /tmp/Foo.java -eval '(progn > (search-forward "// body") (print (which-function)))' > "bar" > Emacs 27 pretest: > $ emacs -Q -batch -l which-func /tmp/Foo.java -eval '(progn > (search-forward "// body") (print (which-function)))' > "class Foo" > That is, Emacs 27 now prints the clas name instead of the method name. > I think the Emacs 26 behavior is preferrable. OK. which-function works by trying out a whole series of functions and returning the first result which is non-nil. CC Mode is now returning a non-nil value (namely "class Foo") for one of these functions where it previously didn't. There're things like backward compatibility (with what exactly, I'm not sure) to take into account before changing things here. I'll look more closely into this in the coming days. > In GNU Emacs 28.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, cairo version 1.16.0) > of 2020-02-25 > Repository revision: 03c07c88d90b5747456b9d286bace2dd4a713aac > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 > System Description: Debian GNU/Linux rodete [ .... ] -- Alan Mackenzie (Nuremberg, Germany).