Improve method for temporarily overriding major-mode-remap-alist#87
Open
noctuid wants to merge 1 commit intorenzmann:mainfrom
Open
Improve method for temporarily overriding major-mode-remap-alist#87noctuid wants to merge 1 commit intorenzmann:mainfrom
noctuid wants to merge 1 commit intorenzmann:mainfrom
Conversation
Let bind major-mode-remap-alist around set-auto-mode-0 instead of using setq-local, and only consider the mode being switched to. Fixes renzmann#84. After doing some more testing this was actually caused by interaction between other plugins (my editorconfig setup) causing set-auto-mode-0 to be called 20+ times when opening a file. Still, this should be an improvement over the old method using setq-local and provides a small performance boost. Let me know if you think there are any potential issues with this method. I also added autoload cookies for some of the user-facing commands. For now I just left the globalized minor mode alone because adding an autoload cookie will cause an error since it will pull in the cl-loop from :predicate into the autoloads file (and the struct doesn't exist yet).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let bind major-mode-remap-alist around set-auto-mode-0 instead of using setq-local, and only consider the mode being switched to.
Fixes #84. After doing some more testing this was actually caused by interaction between other plugins (my editorconfig setup) causing set-auto-mode-0 to be called 20+ times when opening a file.
Still, this should be an improvement over the old method using setq-local and provides a small performance boost. Let me know if you think there are any potential issues with this method.
I also added autoload cookies for some of the commands. For now I just left the globalized minor mode alone because adding an autoload cookie will cause an error since it will pull in the cl-loop from :predicate into the autoloads file (and the struct doesn't exist yet).