Giter Site home page Giter Site logo

Comments (11)

vzaliva avatar vzaliva commented on September 25, 2024

I dug a little further and the relevant information is shown in proof-active-buffer-fake-minor-mode in mode line. How can I make it displayed by default?

from doom-modeline.

seagle0128 avatar seagle0128 commented on September 25, 2024

According to the snippet below, the info is added to minor mode. So just enbale proof-active-buffer-fake-minor-mode and (setq doom-modeline-minor-modes t).

https://github.com/ProofGeneral/PG/blob/0dd686ec46790e918896670b559b11d38a4bb115/coq/coq.el#L3219-L3227

from doom-modeline.

vzaliva avatar vzaliva commented on September 25, 2024

Yes, (setq doom-modeline-minor-modes t) does the trick, but my modeline becomes super cluttered with 9(!) other minor modes shown and does not fit the frame. Is it possible to show just proof-active-buffer-fake-minor-mode in my mode line, not others?

from doom-modeline.

seagle0128 avatar seagle0128 commented on September 25, 2024

If you don't like the default behavior, you can display it in global-mode-string following by the FAQ 5.

e.g.

(add-to-list 'global-mode-string `(" " ,(coq-build-subgoals-string nbgoals nbunfocused)) " ")

PS: I didn't test it. It might be need some tweaks.

from doom-modeline.

vzaliva avatar vzaliva commented on September 25, 2024

Thanks. I tried a similar approach, which kind of worked:

(add-to-list 'global-mode-string  `(" " ,(assoc 'proof-active-buffer-fake-minor-mode minor-mode-alist)) " ")

It shows me the number of goals in the mode line, but it is not updated when the number of goals changes. The Proof General code calls force-mode-line-update when the number of goals changes but apparently, it does not affect doom-modeline.

from doom-modeline.

seagle0128 avatar seagle0128 commented on September 25, 2024
(add-to-list 'global-mode-string  `(" " ,(assoc 'proof-active-buffer-fake-minor-mode minor-mode-alist)) " ")

This doesn't work while the number changes, since it won't be evaluated. You should use function or eval to force to update.

from doom-modeline.

vzaliva avatar vzaliva commented on September 25, 2024

I don't know how to do that. This is a static list. How can I add a function which evaluates later into it?

I want to point out that the Proof General code forces updates of proof-active-buffer-fake-minor-mode string when the number of goals changes. It just did not get propagated to doom-modeline.

from doom-modeline.

seagle0128 avatar seagle0128 commented on September 25, 2024

Try this

(add-to-list 'global-mode-string '(" " (:eval (coq-build-subgoals-string nbgoals nbunfocused))) " ")

from doom-modeline.

vzaliva avatar vzaliva commented on September 25, 2024

There are no nbgoals and nbunfocused variables. They are local variables in coq-update-minor-mode-alist function, not exposed outside.

from doom-modeline.

seagle0128 avatar seagle0128 commented on September 25, 2024
(add-to-list 'global-mode-string '(" " (:eval (assq 'proof-active-buffer-fake-minor-mode minor-mode-alist))) " ")

from doom-modeline.

vzaliva avatar vzaliva commented on September 25, 2024

It worked! Thanks! In case someone else will be looking for the solution: I've added it to the hook for coq-mode in proof general use-package definition:

(use-package proof-general
  :ensure t
  :after doom-modeline
  :mode ("\\.v\\'" . coq-mode)
  :custom
  (coq-smie-user-tokens '(("≈" . "=") ("≡" . "=")))
  (proof-splash-enable nil)
  (coq-prog-name "coqtop")
  (coq-compile-before-require nil)
  :hook
  (coq-mode . (lambda ()
                (ws-butler-mode)
                (helm-mode)
                (add-to-list 'global-mode-string '(" " (:eval (assq 'proof-active-buffer-fake-minor-mode minor-mode-alist))) " ")
                )))

from doom-modeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.