rnkn / fountain-mode

Emacs major mode for screenwriting in Fountain plain-text markup
https://fountain-mode.org
GNU General Public License v3.0
394 stars 15 forks source link

Nothing in mode line with fountain-pages-show-in-mode-line #80

Closed johnnygroovy closed 6 years ago

johnnygroovy commented 6 years ago

Hi !

I've updated to 2.4.1. Everything works very well. It's way faster, especially on long scripts. So congratulations and thank you !

The only problem I have is with fountain-pages-show-in-mode-line. Nothing is showed in my mode-line. Maybe because I'm on emacs-nox ? (25.3-1)

rnkn commented 6 years ago

Hi, thanks, I'm glad it's noticeably faster. I'm unfamiliar with Emacs-nox but there are a few things that might narrow down the issue...

First is that fountain-pages-show-in-mode-line should be either timer or force? It should show something with any non-nil value though.

What's the value of fountain-page-count-string?

What gets returned from M-: (memq 'fountain-page-count-string mode-line-format)? This will test if the string is actually being inserted into the mode-line.

Next, C-h v mode-line-format and look for mode-line-modes. The page count string only gets inserted after the variable mode-line-modes in the mode-line, so if it's not there, it won't get inserted.

rnkn commented 6 years ago

p.s. These all need to be evaluated in a fountain-mode buffer, as it sets mode-line-format as a buffer-local variable on launch.

johnnygroovy commented 6 years ago

Assuming any non-nil value should work, I had written (setq fountain-pages-show-in-mode-line t) in my init file.

I tried with (setq fountain-pages-show-in-mode-line (quote timer)) and now it works !

For your information, with (setq fountain-pages-show-in-mode-line t) fountain-page-count-string is nil M-: (memq 'fountain-page-count-string mode-line-format) gives :

(fountain-page-count-string mode-line-misc-info mode-line-end-spaces)

And the value of mode-line-format is

("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification "   " mode-line-position
 (vc-mode vc-mode)
 "  " mode-line-modes fountain-page-count-string mode-line-misc-info mode-line-end-spaces)
rnkn commented 6 years ago

Ah yes, please use custom. I realise a lot of people denigrate custom, but it will save you a lot of headaches, and versions > 2.4 use custom setter functions to update things like font lock keywords, etc.

I think setting fountain-pages-show-in-mode-line t should be equivalent to force (manual update).

johnnygroovy commented 6 years ago

Okay I'll use custom next time, thanks !