dbordak / telephone-line

A new implementation of Powerline for Emacs
GNU General Public License v3.0
554 stars 51 forks source link

Projectile in telephone-line #61

Closed maindoor closed 6 years ago

maindoor commented 6 years ago

Is there a segment to display projectile project info on the mode line ?

dbordak commented 6 years ago

Not currently, no. What sort of thing are you imagining/how would you like this to look?

anandpiyer commented 6 years ago

@maindoor I use the following to show a "clickable" projectile project name in the mode line:

(telephone-line-defsegment api--projectile-segment ()
    (if (and (fboundp 'projectile-project-name)
             (projectile-project-name))
        (propertize (format " [%s] " (concat (projectile-project-name)))
                    'face '(:inherit)
                    'display '(raise 0.0)
                    'help-echo "Switch Project"
                    'mouse-face '(:box 1)
                    'local-map (make-mode-line-mouse-map
                                'mouse-1 (lambda ()
                                           (interactive)
                                           (projectile-switch-project))))
      (propertize "×" 'face '(:inherit))))

Perhaps this is what you are looking for? I have a bunch of other custom segments defined in my emacs.d config, feel free to use them if you like!

@dbordak, I just found out about telephone-line. Really cool! 👍

hubgitname commented 6 years ago

@anandpiyer

Perfect. This is exactly what I am looking for. Hope @dbordak can include this in the default telephone line from Melpa.

dbordak commented 6 years ago

@anandpiyer you should submit PRs for your segments, I'd love to include more by default!

anandpiyer commented 6 years ago

@dbordak Submitted a PR for window number and projectile project name. I'll try to add more in the future.

dbordak commented 6 years ago

@anandpiyer the projectile segment is now included in the default config!

dbordak commented 6 years ago

@anandpiyer I'm changing the projectile segment a bit in the next commit -- I'm removing the brackets because I'd rather not include internal "separators" on any default segments (it looks kinda redundant since this is a package for adding fancy separators)

anandpiyer commented 6 years ago

Surer, sounds good! Thanks!