Skip to content

Stylish haskell after save #1268

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

Closed
wants to merge 2 commits into from

Conversation

wraithm
Copy link
Contributor

@wraithm wraithm commented Apr 6, 2016

Okay! This actually works. It handles errors appropriately.

(call-process cmd filename
(list (current-buffer) err-file) nil)))
(_errcode
(call-process-region (point-min) (point-max) cmd nil (list (buffer-name tmp-buf) (buffer-name err-buf)) nil))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK can't have buffer for STDERR, has to be a file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked as expected. I tested it. I could do a few more tests or something to be absolutely certain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. It should be more like:

(call-process-region (point-min) (point-max) cmd nil
          (list tmp-buf (make-temp-name "tempxx")) nil))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again, temp file has to be deleted using unwind-protect.

@gracjan
Copy link
Contributor

gracjan commented Apr 6, 2016

Can you rebase on top of current master?

@wraithm
Copy link
Contributor Author

wraithm commented Apr 6, 2016

@gracjan
Copy link
Contributor

gracjan commented Apr 6, 2016

Need to use unwind-protect. Need to use insert-buffer-substring.

@gracjan
Copy link
Contributor

gracjan commented Apr 11, 2016

@wraithm: This is a lovely contribution, I would love to get this in. Can you rebease on mater and add unwind-protect where it is needed?

@wraithm wraithm closed this Apr 11, 2016
@wraithm wraithm deleted the stylish-haskell-after-save branch April 11, 2016 15:35
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.

2 participants