1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 12:40:49 -08:00
emacs/test/lisp/progmodes
Spencer Baugh 3dca52dd42 Remove the header line after disabling 'which-function-mode'
Previously, the header line would stay around even when after
disabling 'which-function-mode', although it may be empty.  Now
the 'which-function-mode' element is properly removed from
'header-line-format', so the header line will disappear if
there's nothing else in 'header-line-format'.

Also, previously, when we ran (which-function-mode), we would
enable
'which-function-mode' for all buffers even if they didn't support
imenu.  We didn't run the normal logic in 'which-func-ff-hook' to
disable 'which-func-mode' if imenu wasn't present.  Now we do run
that logic, by just calling 'which-func-ff-hook'.  This is
especially important when the header line is enabled, because
otherwise there's a very noticeable header line added to every
buffer, including e.g. *Help* and *Buffer List*.

Also, we now check that 'header-line-format' is a list before trying
to add to it; this makes us work properly when enabling and
disabling 'which-function-mode' for modes which set
'header-line-format' to a string or symbol, such as eww.

* lisp/progmodes/which-func.el (which-func-try-to-enable): Re-add
'which-func-format' to the header line.
(which-func--header-line-remove): New function.
(which-func--disable): Call 'which-func--header-line-remove'.
(which-function-mode): Call 'which-func-ff-hook' and
'which-func--header-line-remove'. (bug#66283)
* test/lisp/progmodes/which-func-tests.el: New test.
2023-10-29 13:21:03 +02:00
..
c-ts-mode-resources Fix some cases of incomplete code's indentation [c/c++-ts-mode] 2023-04-10 02:58:46 +03:00
cperl-mode-resources ;cperl-mode.el: Do not mistake a left-shift operator for a here-doc. 2023-10-14 18:22:11 +02:00
elisp-mode-resources lisp/emacs-lisp/lisp-mode.el: Fix parser state corruption. 2021-11-08 07:38:41 +01:00
elixir-ts-mode-resources Fix treesit-langauge-at-point for elixir-ts-mode. 2023-09-26 23:23:54 -07:00
flymake-resources Keep and report "foreign" diangnostics in flymake-cc Flymake backend 2021-09-14 12:22:15 +01:00
go-ts-mode-resources Fix switch statement indentation for go-ts-mode (bug#61238) 2023-02-04 19:26:05 +01:00
heex-ts-mode-resources Add heex-ts-mode (Bug#61996) 2023-03-12 17:40:06 +02:00
java-ts-mode-resources Add more java indentation tests 2023-02-10 20:22:31 +01:00
js-resources Convert manual js indent tests to unit tests 2020-10-18 02:28:22 +02:00
lua-ts-mode-resources Various improvements to lua-ts-mode (Bug#66159) 2023-10-23 10:07:52 +02:00
project-resources Bring back the project--value-in-dir logic 2022-12-09 18:19:36 +02:00
ruby-mode-resources ruby-mode: Fix method call indentation in rhs of multiple assignment 2023-02-28 23:01:04 +02:00
sh-script-resources Fix indentation and fontification in shell-script (Bug#26217) 2023-10-14 11:00:15 -04:00
typescript-ts-mode-resources Add some basic tests for java-ts-mode and typescript-ts-mode 2023-01-16 14:33:27 +01:00
xref-resources Speed up xref rendering for matches on very long lines 2021-03-08 04:25:15 +02:00
asm-mode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
autoconf-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
bat-mode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
bug-reference-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
c-ts-mode-tests.el Cleanup preproc indent for c-ts-mode (bug#61558) 2023-02-19 20:47:05 +01:00
cc-mode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
compile-tests.el Omit the omake compilation-mode rule by default 2023-10-05 12:25:57 +02:00
cperl-mode-tests.el ;cperl-mode.el: Do not mistake a left-shift operator for a here-doc. 2023-10-14 18:22:11 +02:00
eglot-tests.el ; Silence byte-compiler 2023-09-06 14:15:00 +02:00
elisp-mode-tests.el Use new ERT skip-when macro in tests 2023-09-04 18:25:18 +02:00
elixir-ts-mode-tests.el ; Fix source file headers for some test files (bug#62227) 2023-03-17 09:05:50 +02:00
etags-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
executable-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
f90-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
flymake-tests.el Flymake: unbreak tests 2023-09-24 09:07:27 +01:00
gdb-mi-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
glasses-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
go-ts-mode-tests.el Fix switch statement indentation for go-ts-mode (bug#61238) 2023-02-04 19:26:05 +01:00
grep-tests.el New user option 'grep-use-headings' 2023-02-27 21:14:47 +02:00
heex-ts-mode-tests.el ; Fix source file headers for some test files (bug#62227) 2023-03-17 09:05:50 +02:00
hideshow-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
java-ts-mode-tests.el Add some basic tests for java-ts-mode and typescript-ts-mode 2023-01-16 14:33:27 +01:00
js-tests.el Make js-beginning-of-defun return non-nil on success 2023-06-29 08:37:15 +03:00
lua-ts-mode-tests.el bug#65673: Add lua-ts-mode 2023-09-16 13:01:43 +03:00
octave-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
opascal-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
pascal-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
perl-mode-tests.el Fix perl-mode indentation after a hanging paren 2023-09-07 00:13:53 +02:00
project-tests.el (project-try-vc): When found non-VC project root, still search for the backend 2023-09-06 23:30:42 +03:00
ps-mode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
python-tests.el Use new ERT skip-when macro in tests 2023-09-04 18:25:18 +02:00
ruby-mode-tests.el ruby-add-log-current-method: Reduce the use of 'nreverse' 2023-04-13 00:46:11 +03:00
ruby-ts-mode-tests.el Skip ruby-ts-imenu-index test if needed 2023-03-28 13:04:09 +02:00
scheme-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
sh-script-tests.el Fix indentation and fontification in shell-script (Bug#26217) 2023-10-14 11:00:15 -04:00
sql-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
subword-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
tcl-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
typescript-ts-mode-tests.el Add some basic tests for java-ts-mode and typescript-ts-mode 2023-01-16 14:33:27 +01:00
which-func-tests.el Remove the header line after disabling 'which-function-mode' 2023-10-29 13:21:03 +02:00
xref-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00