Skip to content

Commit 4c4cf00

Browse files
committed
auto merge of #8031 : graydon/rust/emacs-mode-rewrite, r=catamorphism
The previous mode did a lot of very manual char-at-a-time parsing and was quite fragile and difficult to maintain. I talked to Marijn and he suggested I'd have better luck just rewriting it from scratch. This is the result of that effort; it seems to be faster, a bit easier on the eyes and more-or-less as well behaved when indenting. The algorithm is a bit different I suspect (it was hard to tell the previous one) but I tried to keep it simple and pleasant-looking.
2 parents 5109ce6 + 581b3db commit 4c4cf00

File tree

4 files changed

+209
-557
lines changed

4 files changed

+209
-557
lines changed

src/etc/emacs/Makefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/etc/emacs/README.md

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,8 @@ file:
1313
(add-to-list 'load-path "/path/to/rust-mode/")
1414
(require 'rust-mode)
1515

16-
Make sure you byte-compile the .el files first, or the mode will be
17-
painfully slow. There is an included `Makefile` which will do it for
18-
you, so in the simplest case you can just run `make` and everything
19-
should Just Work.
20-
21-
If for some reason that doesn't work, you can byte compile manually,
22-
by pasting this in your `*scratch*` buffer, moving the cursor below
23-
it, and pressing `C-j`:
24-
25-
(progn
26-
(byte-compile-file "/path/to/rust-mode/cm-mode.el" t)
27-
(byte-compile-file "/path/to/rust-mode/rust-mode.el" t))
28-
29-
Rust mode will automatically be associated with .rs and .rc files. To
30-
enable it explicitly, do `M-x rust-mode`.
16+
Rust mode will automatically be associated with .rs files. To enable it
17+
explicitly, do `M-x rust-mode`.
3118

3219
### package.el installation via Marmalade or MELPA
3320

@@ -67,24 +54,6 @@ should upgrade in order to support installation from multiple sources.
6754
The ELPA archive is deprecated and no longer accepting new packages,
6855
so the version there (1.7.1) is very outdated.
6956

70-
#### Important
71-
72-
In order to have cm-mode properly initialized after compilation prior
73-
to rust-mode.el compilation you will need to add these `advices` to
74-
your init file or if you are a melpa user install the `melpa` package.
75-
76-
```lisp
77-
(defadvice package-download-tar
78-
(after package-download-tar-initialize activate compile)
79-
"initialize the package after compilation"
80-
(package-initialize))
81-
82-
(defadvice package-download-single
83-
(after package-download-single-initialize activate compile)
84-
"initialize the package after compilation"
85-
(package-initialize))
86-
```
87-
8857
#### Install rust-mode
8958

9059
From there you can install rust-mode or any other modes by choosing

src/etc/emacs/cm-mode.el

Lines changed: 0 additions & 194 deletions
This file was deleted.

0 commit comments

Comments
 (0)