summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-04-05Fill regular block comments correctly too, in addition to rustdoc commentsBrian Mastenbrook
2016-03-10Merge pull request #142 from tromey/remove-emacs-23-supportMicah Chalmer
remove emacs 23 support
2016-03-10update README.md and Package-Requires to require emacs 24Tom Tromey
This updates README.md to remove Emacs 23-related text and to mention that rust-mode requires Emacs 24. It also adds a Package-Requires header to enforce this requirement.
2016-03-09remove emacs 23 supportTom Tromey
This removes the various Emacs 23 compatibility hacks. Fixes #137. Fixes #139. This also obsoletes PR #141.
2016-03-09Merge pull request #138 from kraai/upstreamNiko Matsakis
Document how to install on Debian
2016-03-09Merge pull request #136 from Stebalien/indent-braceNiko Matsakis
Re-indent on }
2016-03-09Merge pull request #132 from tomjakubowski/move-moduleNiko Matsakis
Add rust-promote-module-into-dir
2016-03-08Document how to install on DebianMatt Kraai
2016-03-07Merge pull request #135 from Stebalien/file-localMicah Chalmer
Allow disabling rustfmt with a dir-local/file-local variable
2016-03-07Merge pull request #133 from kraai/avoid-clMicah Chalmer
Use catch and throw instead of block and return
2016-03-07Re-indent on }Steven Allen
Before: fn test() { // Do something }▎ After: fn test() { // Do something }▎
2016-03-07Fix hook args for after-revert-hookSteven Allen
2016-03-07Allow disabling rustfmt with a dir-local/file-local variableSteven Allen
2016-03-07Merge pull request #129 from MicahChalmer/fix-issue-127Niko Matsakis
Run the after-revert hook after rustfmt
2016-03-06Use catch and throw instead of block and returnMatt Kraai
Fixes #130
2016-03-05Add rust-promote-module-into-dirTom Jakubowski
Lacking tests and completely untested on Windows! closes #128
2016-03-03Run the after-revert hook after rustfmtMicah Chalmer
Fix #127
2016-03-03Merge pull request #123 from birkenfeld/fix-unicode-char-escapesNiko Matsakis
Fix font-locking for Unicode escapes in character literals.
2016-02-25Fix font-locking for Unicode escapes in character literals.Georg Brandl
* There is only \u, no \U * \u requires braces, but allows 1-6 hex digits
2016-02-23Merge pull request #122 from kraai/remove-duplicate-keywordsMicah Chalmer
Remove duplicate keywords
2016-02-17Remove duplicate keywordsMatt Kraai
2016-02-16Merge pull request #72 from birkenfeld/builtin-faceMicah Chalmer
Change font-lock face for module paths
2016-02-16Merge pull request #121 from fbergroth/integrate-rustfmtMicah Chalmer
Integrate rustfmt support
2016-02-14Integrate rustfmt supportFredrik Bergroth
Merges the rustfmt package (https://github.com/fbergroth/rust-mode) Fixes #120.
2016-02-14Change font-lock face for module names.Georg Brandl
Use font-lock-constant-face instead of font-lock-type-face. Especially in paths, this tones down the importance of the path prefix, and makes the suffix more visible.
2016-01-16Merge pull request #117 from TheBB/fix-closing-delimFelix S Klock II
Fix indentation of closing delimiters
2016-01-15Fix indentation of closing delimitersEivind Fonn
2016-01-06Merge pull request #116 from Wilfred/type_annotation_highlightingNiko Matsakis
Fix type annotations incorrectly highlighted as modules.
2016-01-05Fix type annotations incorrectly highlighted as modules.Wilfred Hughes
Previously, we were always treating :: as a module, but Rust allows type annotations using :: e.g. parse::<i32>(); This also changes module highlighting so that only the module name is highlighted, excluding the ::. This makes rust-mode consistent with other Emacs modes, such as c++-mode and ruby-mode.
2015-12-15Merge pull request #109 from mrBliss/highlight-unsafeMicah Chalmer
Highlight the unsafe keyword
2015-12-15Merge pull request #113 from MicahChalmer/fix-issue-104Niko Matsakis
Re-fontify buffer after it is reverted
2015-12-15Re-fontify buffer after it is revertedMicah Chalmer
Fix #104
2015-12-03Merge pull request #110 from mrBliss/fix-103Niko Matsakis
Fix #103
2015-12-02Merge pull request #111 from mrBliss/where-indentationFelix S Klock II
Correctly indent where clauses
2015-12-02Fix the special case for the first linemrBliss
This special case broke indentation of `where` clauses.
2015-12-02Correctly indent where clausesmrBliss
Revisit #82. Now rustfmt has a default style for `where` clauses, it makes sense to let rust-mode support it by default. How rust-mode currently indents `where` clauses is totally broken anyway. The line starting with `where` itself, the following lines that are part of the `where` clause, and the body were all indented incorrectly. This commit fixes this. **Note that this commit does not prescribe a certain indentation style for where clauses, but supports the most common ones, including rustfmt's default.** By choosing the location of (1) `where` and (2) the type parameter bounds, the user can follow three major indentation styles. There is no need for a configuration option to choose the style, as the locations of 1 and 2 dictate the style to follow. So all three styles can be used together in the same file. For each major style, the opening brace can be on the last line of the type parameter bounds or on a new line (a or b in the examples). All 6 styles are supported without having to change any configuration option. See the examples below and the new test cases. There is one more style that is unfortunately incompatible with the default `where` indentation style of rustfmt: when the user does not want `where` to be indented, but aligned with the `fn` or `trait` on the line before (see examples `foo4a` and `foo4b` below). To enable this style, the user has to set the new option `rust-indent-where-clause` to nil (it defaults to t). Putting `where` and the type parameter bounds on the same line as the function header is still supported of course (see examples `fooa` and `foob` below). As there is no indentation, this commit does not influence this. Note that rust-mode's indentation has a different goal than rustfmt. rustfmt reflows code, adds or removes line breaks, reindents, etc. rust-mode's indentation only indents lines. The goal is not to imitate rustfmt, but after running rustfmt on a file, reindenting it with rust-mode should be idempotent. This way, users do not have to deal with the eternal battle of differing indentation styles of rustfmt and rust-mode. The supported styles: ```rust fn foo1a(a: A, b: B) -> C where A: Clone + Default, B: Eq, C: PartialEq { let body; } fn foo1b(a: A, b: B) -> C where A: Clone + Default, B: Eq, C: PartialEq { let body; } ``` ```rust fn foo2a(a: A, b: B) -> C where A: Clone + Default, B: Eq, C: PartialEq { let body; } fn foo2b(a: A, b: B) -> C where A: Clone + Default, B: Eq, C: PartialEq { let body; } ``` ```rust fn foo3a(a: A, b: B) -> C where A: Clone + Default, B: Eq, C: PartialEq { let body; } fn foo3b(a: A, b: B) -> C where A: Clone + Default, B: Eq, C: PartialEq { let body; } ``` If the user wants `foo4` instead of `foo1`, `rust-indent-where-clause` must be set to nil. `foo2` and `foo3` are not influenced by this. ```rust fn foo4a(a: A, b: B) -> C where A: Clone + Default, B: Eq, C: PartialEq { let body; } fn foo4a(a: A, b: B) -> C where A: Clone + Default, B: Eq, C: PartialEq { let body; } ``` Unchanged: ```rust fn fooa(a: A, b: B) -> C where A: Clone + Default, ... { let body; } fn foob(a: A, b: B) -> C where A: Clone + Default, ... { let body; } ```
2015-12-01Fix #103: comment indentation after struct membersmrBliss
Correctly indent comments that come after struct members that do not have a trailing comma. Before: struct A { x: u8 // TOO FAR } After: struct A { x: u8 // CORRECT }
2015-11-26Highlight the unsafe keywordmrBliss
2015-11-15Merge pull request #96 from MicahChalmer/add-licensesFelix S Klock II
Add license information
2015-10-23Merge pull request #105 from MicahChalmer/remove-miscNiko Matsakis
Remove unused require of misc.el
2015-10-22Remove unused require of misc.elMicah Chalmer
2015-08-29Merge pull request #97 from syohex/update-urlMicah Chalmer
Update MELPA URL
2015-08-29Update MELPA URLSyohei YOSHIDA
2015-08-29Add basic license informationMicah Chalmer
2015-08-28Merge pull request #84 from birkenfeld/compilation-noteMicah Chalmer
Recognize compiler notes as "info" messages
2015-08-23Recognize compiler help and notes as "info" messagesGeorg Brandl
Otherwise they will be matched as errors by less-specific regexps built into compilation mode.
2015-08-23Merge pull request #77 from tromey/fix-byte-compiler-add-lexbindMicah Chalmer
add lexical binding and have tests check for byte compiler warnings
2015-08-20make rust-mode use lexical bindingTom Tromey
Emacs 24 introduces lexical binding, which should be preferred for new code. This enables it for rust-mode. The code continues to work fine on pre-24 Emacs, and it won't be difficult for this to remain true. One concrete advantage of lexical binding is that it lets the byte-compiler generate better warnings in some cases; here it found a couple of unused variables.
2015-08-20remove byte-compiler warnings and prevent future onesTom Tromey
2015-08-14Merge pull request #69 from tromey/safe-local-variablesMicah Chalmer
set :safe on two defcustoms