Subject: bug#66283: closed (Re: bug#66283: 30.0.50; which-function-mode: When configured to display in header, and toggling off, then does not remove header)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 29 Oct 2023 11:26:03 +0000

Your bug report

#66283: 30.0.50; which-function-mode: When configured to display in header, and toggling off, then does not remove header

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
66283: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66283
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#66283: 30.0.50; which-function-mode: When configured to display in header, and toggling off, then does not remove header
From: Eli Zaretskii <[email-masked]>
To: [email-masked]
Cc: [email-masked], [email-masked], [email-masked], [email-masked]
Date: Sun, 29 Oct 2023 13:24:04 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: [email-masked]
> Date: Sat, 21 Oct 2023 14:43:30 +0000 (UTC)
> Cc: Spencer Baugh <[email-masked]>, [email-masked],
> 	[email-masked], [email-masked]
> 
> > Thanks, but how about some tests for these fixes?  It's high time
> > which-mode had some test suite, I think.
> 
> Sure, here's a patch including a test.

Thanks, installed on the master branch, and closing the bug.

Subject: 30.0.50; which-function-mode: When configured to display in header, and toggling off, then does not remove header
From: Mekeor Melire <[email-masked]>
To: [email-masked]
Cc: Author <[email-masked]>, Committer <[email-masked]>
Date: Sat, 30 Sep 2023 20:41:05 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Execute: emacs -Q

Configure Which Function Mode to display in header by evaluating 
the following; note that this is a new feature in Emacs 30: 
(customize-set-variable 'which-func-display 'header)

Toggle Which Function Mode on by typing: M-x which-function-mode 
RET

Toggle Which Function Mode off by typing again: M-x 
which-function-mode RET

You can see a dysfunctional header. (It won't be update because 
Which Function Mode is off.) To be precise, the value of variable 
`header-line-format' is '(("" which-func-format " ")). Apparently, 
this variable has not been cleaned up appropriately. This is the 
job of the function `which-func--disable'. [1]

In order to test the `which-func--disable' function, type: M-: (which-func--disable) RET

The header disappeared. The value of variable `header-line-format' is `nil'. This means, that the function does its job well. Apparently, it's not being called when toggling off. [2]

[1]: https://git.sv.gnu.org/cgit/emacs.git/tree/lisp/progmodes/which-func.el?h=35fbf6f15830f576fd1909f4a8d30e7ba1d777bd#n225

[2]: Where is the "Turn it off." comment here? https://git.sv.gnu.org/cgit/emacs.git/tree/lisp/progmodes/which-func.el?h=35fbf6f15830f576fd1909f4a8d30e7ba1d777bd#n289

--
In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.37, cairo version 1.16.0)
Windowing system distributor 'The X.Org Foundation', version 
11.0.12101004
System Description: Guix System