Subject: Re: bug#39972: 28.0.50; which-function no longer returning current Java method in Emacs 27

From: Philipp Stephani <[email-masked]>
Date: Thu, 21 May 2020 17:56:16 +0200

Am Mi., 20. Mai 2020 um 21:13 Uhr schrieb Alan Mackenzie <[email-masked]>:
>
> Hello, Philipp.
>
> On Sun, Mar 08, 2020 at 11:33:02 -0000, Alan Mackenzie wrote:
> > In article <[email-masked]> 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.
>
> [ .... ]
>
> > I'll look more closely into this in the coming days.
>
> I've committed two patches to savannah master which I hope have fixed
> this.  One was to CC Mode, the other to lisp/progmodes/which-func.el.
>
> Could you possibly try out these and let me know whether they have, in
> fact, fixed the problem.  Thanks!

Seems to work as expected, thanks.
Do you think you could push these patches onto the release branch, as
this appears to be a regression?