dbordak / telephone-line

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

added telephone-line-vc-dir-segment #91

Closed yilkalargaw closed 1 year ago

yilkalargaw commented 5 years ago

I added a segment for version control information for buffers like dired, magit, eshell etc... where vc-mode is null.

sebasmonia commented 5 years ago

I tested this on Windows and it seemed to be reeeeeaaally slow.

yilkalargaw commented 5 years ago

Yes I forgot to test it on windows. Will try it out when I find a windows pc. I will see if I could patch it.

dbordak commented 5 years ago

Sorry, missed this PR first time around. I'll hold off on merging it until you guys get that issue sorted, though.

francesco-cadei commented 5 years ago

What do you think about this, for unix-like systems?

  (telephone-line-defsegment* telephone-line-git-project
    (replace-regexp-in-string "\n$" ""
                              (shell-command-to-string
                               "basename $(git rev-parse --show-toplevel 2>/dev/null) 2>/dev/null")))

  (telephone-line-defsegment* telephone-line-git-branch
    (replace-regexp-in-string "\n$" ""
                              (shell-command-to-string
                               "git rev-parse --abbrev-ref HEAD 2>/dev/null")))
sebasmonia commented 5 years ago

I tried eval-region and got...

Malformed arglist: (lambda (face) (replace-regexp-in-string $ (shell-command-to-string echo "$(basename $(git rev-parse --show-toplevel 2>/dev/null) 2>/dev/null)::$(git rev-parse --abbrev-ref HEAD 2>/dev/null)")))

I think this has something to do with the macro expansion, but my elisp (or lisp in general) are not THAT good :)

francesco-cadei commented 5 years ago

Ok should be interesting to get the current magit-project and the current magit-brach.