Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does wc-mode work with doom-emacs? #18

Open
maikol-solis opened this issue Mar 8, 2021 · 3 comments
Open

Does wc-mode work with doom-emacs? #18

maikol-solis opened this issue Mar 8, 2021 · 3 comments

Comments

@maikol-solis
Copy link

I installed this package today in doom-emacs, but I can't see any word count in the modeline.
How could I do to enable it ?

Thanks.

@maikol-solis maikol-solis changed the title Does wc-mode works with doom-emacs? Does wc-mode work with doom-emacs? Mar 9, 2021
@BlueDrink9
Copy link

@bnbeckwith how does wc-mode update the modeline? I can't see where in the lisp code (eg

(defun wc-generate-modeline ()
) where any variable actually gets set.

Doom modeline supports mode-line-misc-info and global-mode-string, would either of those be worth setting?

Alternatively, if we wanted to manually set those ourselves, which function should we call to return the formatted string?

@bnbeckwith
Copy link
Owner

In the mode definition, there is a line that sets the lighter or mode line for vanilla emacs. That line just presents the contents of the (buffer-local) variable wc-buffer-stats. If you have a way to show that variable (and refresh it), then that's what you'll want to set.

:lighter (:eval wc-buffer-stats)

@MattMicheletti
Copy link

MattMicheletti commented Oct 27, 2021

Not directly related to Doom Emacs but I was using the Moody mode line and always wondered if this package was broken (it's not). I finally spent some time today to figure this out. I just needed to add the following in my init.el during wc-mode's setup:

(add-to-list 'global-mode-string '(:eval wc-buffer-stats) 'APPEND) ; Add Word Count stats for the current buffer into the global mode line string (updates dynamically per buffer)

Hope this helps anyone who may have the same issue and wonder why the mode line is not showing the word count information.

@bnbeckwith Could I recommend adding a note about the need to configure wc-mode for custom mode lines in the README.org? Perhaps using the aforementioned one-line as an example of a "simple" solution (albeit a naive one, I am sure). It would help people out who may be expecting mode line functionality out of the box.

Thanks for a great little Emacs package BTW :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants