I want to call some methods in the Emacs mode-line format. For example count-words
to see how many characters are selected or what's the class/method name cursor is on.
This is my current mode-line format, but calling count-words
, it shows *invalid*
as a result and also I'm not sure that it will be invoked in any changes.
(setq-default mode-line-format
(list "---File:[%b%+] Line:[%l] Size:[%i] "
(count-words (point-min) (point-max))
))
I want to call some custom methods in the mode-line area which are updating frequently. For example, how many characters I've selected, who changed this line (git blame), what is the current class name which the cursor is on now, and so on.