aboutsummaryrefslogtreecommitdiffstats
path: root/src/casefiddle.c
diff options
context:
space:
mode:
authorSpencer Baugh2023-10-21 10:41:42 -0400
committerEli Zaretskii2023-10-29 13:21:03 +0200
commit3dca52dd422c50ebf24a304e7c3d36cf5f1c55cf (patch)
treed6d7d6fa292027a2328adbac2d65f28cecf5f82c /src/casefiddle.c
parent27ccf2230bced7248a86e3741b45734bde77cb42 (diff)
downloademacs-3dca52dd422c50ebf24a304e7c3d36cf5f1c55cf.tar.gz
emacs-3dca52dd422c50ebf24a304e7c3d36cf5f1c55cf.zip
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.
Diffstat (limited to 'src/casefiddle.c')
0 files changed, 0 insertions, 0 deletions