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

Add a hook run after code changes have been applied #8

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

akirak
Copy link
Contributor

@akirak akirak commented Oct 30, 2024

Hello, thank you for creating this great package.

I usually use smerge-mode to confirm the hunk suggested via elysium. It would be nice if the mode were turned on after changes have been applied. This elysium-apply-changes-hook will let the user configure such a behaviour.

An example configuration is as follows:

(add-hook 'elysium-apply-changes-hook #'smerge-mode)

@lanceberge
Copy link
Owner

lanceberge commented Nov 2, 2024

Thank you for this. Adding this hook looks good, although wouldn't the example you provided toggle smerge-mode on and off with every call to elysium-apply-changes?

It's failing CI - I believe you will need to default the hook to nil

(defcustom elysium-apply-changes-hook nil
  "Hook run after code changes have been applied on a buffer."
  :group 'elysium
  :type 'hook)

@akirak
Copy link
Contributor Author

akirak commented Nov 2, 2024

It's failing CI - I believe you will need to default the hook to nil

Thank you for pointing this out. I've force-pushed the fix.

the example you provided toggle smerge-mode on and off with every call to elysium-apply-changes

Yes, you are right. It should have been like this:

(add-hook 'elysium-apply-changes-hook #'smerge-start-session)

@lanceberge
Copy link
Owner

Looks good, thank you

@lanceberge lanceberge merged commit dcb194e into lanceberge:main Nov 2, 2024
4 checks passed
@akirak akirak deleted the apply-changes-hook branch November 3, 2024 02:57
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