Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable parsing std.Progress output #70

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

erikarvstedt
Copy link
Contributor

@erikarvstedt erikarvstedt commented Apr 26, 2022

This PR (based on #69) enables parsing std.Progress output in compilation and shell buffers.
In particular, it unlocks proper parsing of progress output of zig build/run/... cmds.

Marked as a draft, because the implementation is a bit hacky. It requires overriding ansi-color-apply-on-region with a patched implementation (here's the patch diff).
If you're interested in merging this, I'll add an implementation for Emacs 29.

You can test this with:

# Call this once to enable progress parsing
(zig-enable-progress-parsing)

# Run a `zig build-exe` demo command.
# Delete ~/.cache/zig to force compilation progress output.
(let ((compilation-environment '("TERM=ansi"))
      (shell-file-name "bash"))
  (compilation-start "rm -rf ~/.cache/zig && cd /tmp && echo 'pub fn main() void {}' > src.zig && zig build-exe src.zig"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant