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

[MERGED] Compute patch result at compile time #11

Closed

Conversation

PythonNut
Copy link
Contributor

@PythonNut PythonNut commented Jul 29, 2017

This should move the patch computation to compile time, allowing the byte compiler to optimize the function definitions ahead of time. It also means that el-patch need not be loaded at runtime, unless the user would like to interact with the patches using el-patch's UI.

I'm currently running this, but it may take some work to get it into a mergable state.

@raxod502
Copy link
Member

Indeed. As you've probably noticed, the Travis build is failing due to a byte-compilation error. Also, could you make sure there are no lines longer than 80 characters?

Otherwise this looks fantastic. Looking forward to merging.

@raxod502
Copy link
Member

Oh yes—the README (new section, I think, for compile-time-only usage) and CHANGELOG (the Unreleased section; see Keep a Changelog) will also need to be updated.

@PythonNut
Copy link
Contributor Author

PythonNut commented Jul 29, 2017

@raxod502 for patches to be defined without el-patch at runtime, the user would need to copy the el-patch--patches defvar into their init. Can this be avoided reasonably?

@raxod502
Copy link
Member

Can't we make it so that el-patch--patches is initialized if necessary before having a puthash done to it? Then the documentation string will be added if and when el-patch is loaded.

Alternatively, we could autoload el-patch--patches, which is probably a more elegant solution. I'd put in a vote for the latter.

This is so the user need not define it manually before using el-patch
only at compile time.
@PythonNut
Copy link
Contributor Author

Is this what you had in mind?

@raxod502
Copy link
Member

Should be fine. I will most likely make some editorial changes so that the style is consistent. But that is easy enough.

I don't think el-patch-feature will work without el-patch-pre-validate-hook also being autoloaded.

@PythonNut
Copy link
Contributor Author

Hooks are automatically defined if they didn't previously exist, right?

@raxod502
Copy link
Member

You're right. I guess there's no need for autoloading the hook.

@raxod502
Copy link
Member

Cherry-picked in 4731a62. Please test.

@raxod502 raxod502 closed this Jul 29, 2017
@raxod502 raxod502 changed the title Compute patch result at compile time [MERGED] Compute patch result at compile time Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants