I'm trying to fix a problem with this project: https://github.com/domtronn/spaceline-all-the-icons.el

Specifically this code which is supposed to count the number of commits ahead of another branch the current branch is: https://github.com/domtronn/spaceline-all-the-icons.el/blob/master/spaceline-all-the-icons-segments.el#L818

The problem is that vc-git-log-outgoing is asynchronous, and the count-lines stuff ends up counting the lines before vc-git-log-outgoing completes - so it always returns 0.

I've been able to get it to "work" with hacks like (sit-for 0.1) but this feels wrong. What's the correct way to modify this code so that count-lines only happens after vc-git-log-outgoing completes?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.