| Age | Commit message (Collapse) | Author |
|
|
|
remove emacs 23 support
|
|
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.
|
|
This removes the various Emacs 23 compatibility hacks.
Fixes #137.
Fixes #139.
This also obsoletes PR #141.
|
|
Document how to install on Debian
|
|
Re-indent on }
|
|
Add rust-promote-module-into-dir
|
|
|
|
Allow disabling rustfmt with a dir-local/file-local variable
|
|
Use catch and throw instead of block and return
|
|
Before:
fn test() {
// Do something
}▎
After:
fn test() {
// Do something
}▎
|
|
|
|
|
|
Run the after-revert hook after rustfmt
|
|
Fixes #130
|
|
Lacking tests and completely untested on Windows!
closes #128
|
|
Fix #127
|
|
Fix font-locking for Unicode escapes in character literals.
|
|
* There is only \u, no \U
* \u requires braces, but allows 1-6 hex digits
|
|
Remove duplicate keywords
|
|
|
|
Change font-lock face for module paths
|
|
Integrate rustfmt support
|
|
Merges the rustfmt package (https://github.com/fbergroth/rust-mode)
Fixes #120.
|
|
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.
|
|
Fix indentation of closing delimiters
|
|
|
|
Fix type annotations incorrectly highlighted as modules.
|
|
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.
|
|
Highlight the unsafe keyword
|
|
Re-fontify buffer after it is reverted
|
|
Fix #104
|
|
Fix #103
|
|
Correctly indent where clauses
|
|
This special case broke indentation of `where` clauses.
|
|
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;
}
```
|
|
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
}
|
|
|
|
Add license information
|
|
Remove unused require of misc.el
|
|
|
|
Update MELPA URL
|
|
|
|
|
|
Recognize compiler notes as "info" messages
|
|
Otherwise they will be matched as errors by less-specific regexps
built into compilation mode.
|
|
add lexical binding and have tests check for byte compiler warnings
|
|
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.
|
|
|
|
set :safe on two defcustoms
|