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

Begin gentle refactor #221

Merged
merged 11 commits into from
Nov 23, 2019
Merged

Conversation

Gastove
Copy link
Contributor

@Gastove Gastove commented Oct 29, 2019

Important: this is the second PR in a sequence. It contains changes being PRed as #219, which should be reviewed and merged first.

This PR is part of the work documented in #218.

What's here?

This PR builds on #219 by performing further clean-up and refactoring on the new fsharp-mode-structure module. A lot of code is simply re-organized, and a deal of comments and notes are added. Some small modernizations are introduced, like save-mark-and-excursion.

Clean up tabs, indentation.
These are two modules that do tightly related things. In two separate files,
they can't cleanly share variables (`indent-smie` re-defined an indent offset
var also defined in `indent`). This commit merges them together and re-names the
variable used for offset by the `smie` configs, but does nothing else.
This commit renames `fsharp-mode-indent` and cleans up references to it. It also
scoots `fsharp-eval-phrase` next to `fsharp-eval-region` in `fsharp-mode`, where
it makes a bit more sense.

Tests are all currently passing.
This commit removes some old "major mode boilerplate" from
`fsharp-mode-structure`:

- The abbrev table is moved in to `fsharp-mode`, where it belongs.

- `fsharp-safe` is _only_ used to wrap calls to `search-backwards`; the only
value it provides is to swallow errors and instead return `nil`. However: this
can now be much more idiomatically achieved by passing `t` as the `NOERROR`
argument to `search-backward`.

- XEmacs hasn't had a release in ten years. The extra region setting calls of
`fsharp-keep-region-active` aren't needed -- it's just extra noise.
This allows it to do precisely the same thing, while making very sure to fulfill
the guarantee of not changing whatever point and mark the user set.
@juergenhoetzel juergenhoetzel merged commit 82e61d6 into fsharp:master Nov 23, 2019
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.

None yet

2 participants