jonathanchu / emacs-powerline

Powerline for Emacs
497 stars 37 forks source link

Replace with new version? #13

Closed milkypostman closed 9 years ago

milkypostman commented 12 years ago

Jonathan,

I have basically rewritten a large part of powerline so that it can be used more easily and acts as a library for generating parts of the mode-line; mainly the only thing that needed to change was figuring out how to calculate the size of elements and generating dividers.

My code can be found at milkypostman/powerline which I have called "Version: 2.0".

It basically provides a library of functions that can be used in the mode-line. and so you can do something like,


(setq-default mode-line-format
              '("%e"
                (:eval
                 (let* ((active (eq (frame-selected-window) (selected-window)))
                        (face1 (if active 'powerline-active1 'powerline-inactive1))
                        (face2 (if active 'powerline-active2 'powerline-inactive2))
                        (lhs (concat
                              (powerline-raw "%*" nil 'l)
                              (powerline-buffer-size nil 'l)
                              (powerline-buffer-id nil 'l)

                              (powerline-arrow-right nil face1)

                              (powerline-major-mode face1 'l)
                              (powerline-minor-modes face1 'l)
                              (powerline-raw mode-line-process face1 'l)

                              (powerline-narrow face1 'l)

                              (powerline-arrow-right face1 face2)

                              (powerline-vc face2)
                              ))
                        (rhs (concat
                              (powerline-raw global-mode-string face2 'r)

                              (powerline-arrow-left face2 face1)

                              (powerline-raw "%4l" face1 'r)
                              (powerline-raw ":" face1)
                              (powerline-raw "%3c" face1 'r)

                              (powerline-arrow-left face1 nil)
                              (powerline-raw " ")

                              (powerline-raw "%6p" nil 'r)

                              (powerline-hud face2 face1))))
                   (concat lhs (powerline-fill face2 (length (format-mode-line rhs))) rhs)))))

Since there doesn't seem to be a single maintainer, your repo seemed to be the most active.

jonathanchu commented 12 years ago

This looks really good - thank you! Let me test this locally on v23 and 24 and I'll merge if all looks good. Sorry for the delay in response!

jonathanchu commented 9 years ago

Cleaning up the open issues. :cake: