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

added optional method chain indentations for emacs major mode #19913

Merged
merged 2 commits into from
Jan 22, 2015

Conversation

KOMON
Copy link
Contributor

@KOMON KOMON commented Dec 16, 2014

I added an option to auto-indent method chains to line up along their '.' operators. Like so:

let input = io::stdin().readline()
                       .ok()
                       .expect("Failed to read line");

The old default would indent like so:

let input = io::stdin().readme()
    .ok()
    .expect("Failed to read line");

The Rust guide explicitly condones the former, so I thought it would be nice for the emacs mode to support it. It's off by default, you have to set rust-indent-method-chain to t via your .emacs or the customize menu

@vhbit
Copy link
Contributor

vhbit commented Dec 17, 2014

@KOMON cool! Have you though of also of implementing auto-indentation for where clauses?

@emberian
Copy link
Member

emberian commented Jan 5, 2015

The tabs should be replaced with spaces.

@nikomatsakis
Copy link
Contributor

Holy macarel! I've been idly wishing someone would do this. ✌️

@flaper87
Copy link
Contributor

flaper87 commented Jan 8, 2015

@KOMON thanks... a lot! 💃

@huonw
Copy link
Member

huonw commented Jan 19, 2015

r? @pnkfelix

(I don't know of any other reviewer as experienced with emacs as you, @pnkfelix.)

@pnkfelix
Copy link
Member

@bors: r+ a72bd69

@pnkfelix
Copy link
Member

@bors: r-

@KOMON can you replace the tabs with spaces as requested by @cmr ? (Once that's in place, r=me)

@KOMON
Copy link
Contributor Author

KOMON commented Jan 20, 2015

@pnkfelix r=

@pnkfelix
Copy link
Member

@bors: r+ 8051bd0

@bors
Copy link
Contributor

bors commented Jan 21, 2015

⌛ Testing commit 8051bd0 with merge 3dc33d9...

@bors
Copy link
Contributor

bors commented Jan 21, 2015

💔 Test failed - auto-mac-64-opt

@alexcrichton
Copy link
Member

@bors: retry

@alexcrichton
Copy link
Member

@bors: rollup

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 21, 2015
I added an option to auto-indent method chains to line up along their '.' operators. Like so:

```
let input = io::stdin().readline()
                       .ok()
                       .expect("Failed to read line");
```

The old default would indent like so:
```
let input = io::stdin().readme()
    .ok()
    .expect("Failed to read line");
```

The Rust guide explicitly condones the former, so I thought it would be nice for the emacs mode to support it. It's off by default, you have to set ```rust-indent-method-chain``` to ```t``` via your .emacs or the customize menu
@alexcrichton
Copy link
Member

@bors: retry

@bors bors merged commit 8051bd0 into rust-lang:master Jan 22, 2015
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.

9 participants