forked from sorellabs/renpy-mode
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Repair this mode #4
Open
morganwillcock
wants to merge
36
commits into
Reagankm:master
Choose a base branch
from
morganwillcock:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
The existing code indents using tabs. The existing code is filled to 80 characters at its widest.
The version used it taken from https://github.com/leoliu/python-el which has additional changes by Leo Liu.
imenu needs to loaded if imenu is going to be setup. rx should be pre-loaded but make the dependency clear.
This is left over from the original python mode but requires the comint integration which was already removed.
This is user preference and so shouldn't be touched.
The newer one calls functions that don't exist. Presumably someone was trying to modify the fill behaviour for strings but didn't actually finish it.
Track copyright based commit history. Use a single meta-data block for this mode, remove data that relates to python.el, fix maintainer information. This file is not part of GNU Emacs. Ren'Py is not Visual Studio.
Removes the original python checks. Fixes the modified code to deal with comments appearing after the colon.
Update docstring. Remove reference to an Emacs version. Add tag and prefix.
Show labels at the top level of menu. Other entries are under sub-menus which are prefixed with "/" (which is not a valid character to begin a label name, so typing "/" with the default completion system will just show the sub-menus).
Skip backwards over comments.
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.
These changes are effectively a reset of the what was modified in the original python mode and then a re-implementation of what I think the changes were actually meant to do. It is difficult to know for sure because the package is not functional in its current state (it looks like some parts were never finished and it doesn't match the renpy mode which was once in renpy git repository) but I think I've implemented what the original intentions were, so this covers:
Beyond that I've cleaned up other parts of the package which looked to be wrong or wouldn't apply to renpy, this includes clearing all flymake and package-lint warnings and errors.
The font-locking is re-implemented using rx-let which raises the minimum Emacs version to 27.1. It only aims for partial coverage of keywords to try and minimise issues of highlighting in the wrong context. It won't be perfect, and there are likely still too many to be correct in every case, but it should be enough to be useful and look reasonable most of the time.
Imenu support is re-implemented to separate some matches into sub-menus . Only labels show at the top level of the menu. It is now bound to the same key sequence that the current python.el uses.
Outline mode support should allow any block to collapse. There will be some false matches within multi-line strings and comments, so collapsing everything may not make sense, but it is enough to manually collapse and expand what is under point (someone would probably bind a key to 'outline-cycle' if they wanted to use it).
The only change that might be opinionated was to remove the 3 characters from comments which prevented the file being encoded as ASCII. For the sake of portability, the fancier comments didn't seem worth it.
I haven't done anything with renpy-current-defun or modified the definitions of what a "defun" is. These remain python specific.
I haven't re-indented sections of the original python.el which don't match the default indentation positions that Emacs wants to apply by default.
I haven't increased the package version number.
Closes #2, fixes #3.