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

Fix the issue of before-save-hook being added globally #24

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

akirak
Copy link
Contributor

@akirak akirak commented Aug 13, 2022

When you enable org-make-toc-mode, org-make-toc is added to before-save-hook globally, and the following message is printed every time if you save a buffer, even if the buffer is not in org-mode:

org-make-toc: No TOC node found.

This PR fixes the issue.

@alphapapa alphapapa self-assigned this Aug 30, 2024
@alphapapa alphapapa added the bug label Aug 30, 2024
@alphapapa alphapapa added this to the 0.6 milestone Aug 30, 2024
@alphapapa alphapapa merged commit 56d8c66 into alphapapa:master Aug 30, 2024
@alphapapa
Copy link
Owner

Hi Akira,

Thanks for sending this fix. Apparently I overlooked it in my notifications; feel free to ping me in the future if I miss such things. This is a simple, obvious fix, but I actually don't use the mode myself (I add to the before-save-hook in specific files' local variables), so I hadn't noticed it.

@akirak akirak deleted the fix-global-hook branch August 31, 2024 01:12
@akirak
Copy link
Contributor Author

akirak commented Aug 31, 2024

I see. I have been using this patch for two years myself. I rebased the branch just to update my installation yesterday. No worries.

Nowadays GitHub has built-in TOC navigation, so generating TOCs doesn't seem obligatory.

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

Successfully merging this pull request may close these issues.

2 participants