2

I'm trying to customize Helm buffers' mode-line.

I have set mode-line-format with powerline package:

(setq-default
 mode-line-format
 '("%e"
   (:eval
    (let* ((active (powerline-selected-window-active))

           ;; Conditionnal faces (in function of `active')
           ...

           ;; Left elements
           (lhs ...)

           ;; Right elements
           (rhs ...))

      ;; Build the result
      (concat
       (powerline-render lhs)
       (powerline-fill mode-line-3-face (powerline-width rhs))
       (powerline-render rhs))))))

From what I understand from helm-mode-line-string's documentation:

Help string displayed in mode-line in helm'. It can be a string or a list of two args, in this case, first arg is a string that will be used as name for candidates number, second arg any string to display in mode line. If nil, use defaultmode-line-format'.

I should be able to have my customized mode-line everywhere (in every buffers) with:

(setq-default helm-mode-line-string nil)

Isn't this line from helm.el supposed to do exactly what I want?

(setq mode-line-format (default-value 'mode-line-format))

Edit

Works as intended with: helm-colors, helm-projectile-ag, helm-projectile-grep.

But not with: helm-M-x, helm-projectile-find-file, helm-projectile-switch-project.

  • Yes, it is, setting helm-mode-line-string to nil will keep helm from building its own mode-line-format, which works as expected (I can confirm). – xuchunyang Feb 25 '16 at 13:56
  • And yet I still get the Helm-made on helm-M-x, any idea? Update post. – Mathieu Marques Feb 25 '16 at 13:58
  • I get it too. I didn't test it carefully. helm-mode-line-string will not matter if helm source has 'mode-line slot set, such as in helm-M-x and helm-regexp. Since helm sets its own mode-line-format in helm-display-mode-line, you can set your mode-line-format there by advising the function (spaceline's spaceline-helm-mode is using this way: github.com/TheBB/spaceline/blob/…). – xuchunyang Feb 25 '16 at 14:20
  • I had no idea someone had extracted Spacemacs' powerline! I originally gave up on using Spacemacs' source and started to build my own mode-line. Probably going to give this one a shot since I got a tad more proficient with Emacs Lisp :) thanks for the link. – Mathieu Marques Feb 25 '16 at 15:15
1

Spaceline helped me customize the mode-line for Helm buffers (uses helm-alive-p).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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