Open thorstengrothe opened 6 years ago
I forgot to say that boon has three different states, you can see this in his Powerline config
Thorsten
Hey, I'll look at this more closely over the coming week, but my first thought is that this looks like what happens when you try to use an eval-when-load
'd segment before the package it depends upon is actually loaded. I'm not sure exactly how the load order works with use-package, though.
Hi,
most of it is running now.
telephone-line.el
(defcustom telephone-line-faces
'((evil . telephone-line-modal-face)
(modal . telephone-line-modal-face)
(ryo . telephone-line-ryo-modal-face)
(boon . telephone-line-boon-mode-face) ;; BOON
(accent . (telephone-line-accent-active . telephone-line-accent-inactive))
(nil . (mode-line . mode-line-inactive)))
(defun telephone-line-boon-mode-face (active)
"Return an appropriate face depending whether boon-mode
is activated, given whether frame is ACTIVE."
(cond ((not active) 'mode-line-inactive)
((not (boundp 'boon-mode)) 'mode-line) ;; This does not work
(boon-insert-state 'telephone-line-evil-insert)
(boon-special-state 'telephone-line-evil-emacs)
(t 'telephone-line-evil-normal)))
telephone-line-segments.el
(eval-after-load 'boon
'(telephone-line-defsegment* telephone-line-boon-mode-segment ()
(let ((tag (cond
(boon-command-state "BOON")
(boon-insert-state "INS")
(boon-special-state "SPC")
)))
(if telephone-line-evil-use-short-tag
(seq-take tag 1)
tag))))
The three states command/insert/special are working but if I disable Boon the evil tag does not vanish. Can you look at it, if you have time?
Regards Thorsten
Sorry, unfortunately I closed the issue, my mistake. I reopen it again.
Thorsten
If you want the segment to return nil when you're not using boon
, you'd need to write that yourself; there's no code here that says what to do when boon
is loaded but not enabled.
Ok, I see. No problem I can live with that. For me it's working fine. Should the above code merged to to the official telephone-line
package?
Sure, I don't see why not.
I'm in the process of finding the right modal mode for me, now I'm testing Boon Mode. So tried to make telephone-line compatible with Boon on my own. I added this to
telephone-line-segments.el
and this to
telephone-line.el
and this
This is my config
But this does not work:
telephone-line/:config: Wrong type argument: sequencep, telephone-line-boon-mode-segment
What I'm doing wrong? Thorsten