I'm having trouble hiding the display of which-func from powerline. I'm successfully showing it in the header, but it stubbornly won't be removed from powerline. I've tried the following:

(setq mode-line-format (delete (assoc 'which-func-mode
                                      mode-line-format) mode-line-format))

(setq mode-line-misc-info (delete (assoc 'which-func-mode
                                         mode-line-misc-info) mode-line-misc-info)

(setq mode-line-format (assq-delete-all 'which-func-mode mode-line-format))

(setq mode-line-misc-info (assq-delete-all 'which-func-mode mode-line-misc-info))

Also tried the following, hooking into various points around both powerline and which-func:

(powerline-which-func 'which-func nil)
(powerline-raw which-func-format nil 'l)

I've had this working in the past, but no joy this time round.


  • 1
    It might help if you post the value of mode-line-format and mode-line-misc-info to identify what needs to be removed.
    – nispio
    Commented Apr 18, 2016 at 20:38
  • Apologies to @lunaryorn, et al; I didn't realise I needed to specify I have powerline enabled. Question updated to reflect this. Commented Apr 20, 2016 at 7:09

1 Answer 1


This works for me:

(let ((which-func '(which-func-mode ("" which-func-format " "))))
   (setq-default mode-line-format (remove which-func mode-line-format))
   (setq-default mode-line-misc-info (remove which-func mode-line-misc-info))
   (setq-default header-line-format which-func))

It removes which-func from the mode-line, and place it in the header.

  • Unfortunately this also doesn't seem to work for me. Commented Apr 18, 2016 at 19:53
  • 1
    @unpluggd Assuming the default setup this would work. If it doesn't, your mode line setup is probably very different from the default. Would you mind to edit your question and add the values of the relevant variables?
    – user227
    Commented Apr 19, 2016 at 7:23
  • Thanks @lunaryorn. I was assuming the default setup, although this works with smart-mode-line too. Commented Apr 19, 2016 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.