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 some emacs mode indentation issues #8872

Closed
wants to merge 4 commits into from

Conversation

MicahChalmer
Copy link
Contributor

This fixes some, but not all, of the issues mentioned in #8787

@pnkfelix
Copy link
Member

Even with this patch, there are still a couple of hiccups, such as this:

struct Foo { a: int,
             b: int,
             c: int
}

struct Bar {a: int,
               b: int,
               c: int
}

But, it seems to improve things significantly, and I have not identified any serious regressions injected by it.

bors added a commit that referenced this pull request Aug 30, 2013
This fixes some, but not all, of the issues mentioned in #8787
@bors bors closed this Aug 30, 2013
bors added a commit that referenced this pull request Sep 7, 2013
…tsakis

Here are fixes for more problems mentioned in #8787.  I think I've addressed everything mentioned there except for @nikomatsakis's comment about match/patterns now.  (This also fixes the bug in struct alignment that @pnkfelix mentioned from my earlier pull request #8872.)

The biggest change here is to make fill-paragraph (M-q) and auto-fill-mode work inside different variations of multi-line and doc comments.  Because of the way emacs paragraph fills work (callbacks interacting with global regexp variables that are used in odd ways) there were quite a few edge cases that I had to work around.

The only way I was able to keep it all straight was to create some regression tests.  They use the emacs lisp regression testing tool ERT, and are included as the last commit here.  I added a few tests for indentation as well.  I have not attempted to integrate the tests into the overall rust compiler build process, since I can't imagine anyone would want the compiler build to have a dependency on emacs.  Maybe at some point tools like this get their own repositories?  Just a thought.

One other thought related to the tests: should there be a place to put these types of style samples that isn't specific to one text editor?  Maybe as part of an official rust style guide, but in a form that would allow tools like this to pull out the samples and use them for tests?
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 4, 2022
update dependencies

changelog: none

Updating some dependencies, but the biggest one is clap to v3, but without using the derive struct thingy.
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.

3 participants