Skip to content

Commit 73b68ef

Browse files
committed
---
yaml --- r: 29881 b: refs/heads/incoming c: 4e91f29 h: refs/heads/master i: 29879: 9b23a81 v: v3
1 parent 95587b8 commit 73b68ef

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: be4f9753e49b8feefe0283adf0c966166bb96f29
9+
refs/heads/incoming: 4e91f299a8344375385a68bc029613aeacdbd09b
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/etc/emacs/README.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,31 @@ it, and pressing `C-j`:
2929
Rust mode will automatically be associated with .rs and .rc files. To
3030
enable it explicitly, do `M-x rust-mode`.
3131

32-
### package.el installation via Marmalade
32+
### package.el installation via Marmalade or MELPA
3333

3434
It can be more convenient to use Emacs's package manager to handle
3535
installation for you if you use many elisp libraries. If you have
36-
package.el but haven't added Marmalade, the community package source,
36+
package.el but haven't added Marmalade or MELPA, the community package source,
3737
yet, add this to ~/.emacs.d/init.el:
3838

39+
Using Marmalade:
40+
3941
```lisp
4042
(require 'package)
4143
(add-to-list 'package-archives
4244
'("marmalade" . "http://marmalade-repo.org/packages/"))
4345
(package-initialize)
4446
```
4547

48+
Using MELPA:
49+
50+
```lisp
51+
(require 'package)
52+
(add-to-list 'package-archives
53+
'("melpa" . "http://melpa.milkbox.net/packages/") t)
54+
(package-initialize)
55+
```
56+
4657
Then do this to load the package listing:
4758

4859
* <kbd>M-x eval-buffer</kbd>
@@ -56,18 +67,6 @@ should upgrade in order to support installation from multiple sources.
5667
The ELPA archive is deprecated and no longer accepting new packages,
5768
so the version there (1.7.1) is very outdated.
5869

59-
From there you can install rust-mode or any other modes by choosing
60-
them from a list:
61-
62-
* <kbd>M-x package-list-packages</kbd>
63-
64-
Now, to install packages, move your cursor to them and press i. This
65-
will mark the packages for installation. When you're done with
66-
marking, press x, and ELPA will install the packages for you (under
67-
~/.emacs.d/elpa/).
68-
69-
* or using <kbd>M-x package-install rust-mode
70-
7170
#### Important
7271

7372
In order to have cm-mode properly initialized after compilation prior
@@ -85,3 +84,17 @@ your init file or if you are a melpa user install the `melpa` package.
8584
"initialize the package after compilation"
8685
(package-initialize))
8786
```
87+
88+
#### Install rust-mode
89+
90+
From there you can install rust-mode or any other modes by choosing
91+
them from a list:
92+
93+
* <kbd>M-x package-list-packages</kbd>
94+
95+
Now, to install packages, move your cursor to them and press i. This
96+
will mark the packages for installation. When you're done with
97+
marking, press x, and ELPA will install the packages for you (under
98+
~/.emacs.d/elpa/).
99+
100+
* or using <kbd>M-x package-install rust-mode

branches/incoming/src/etc/emacs/rust-mode.el

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
(c-populate-syntax-table table)
2222
table))
2323

24-
(add-to-list 'auto-mode-alist '("\\.rs$" . rust-mode))
25-
(add-to-list 'auto-mode-alist '("\\.rc$" . rust-mode))
26-
2724
(defun make-rust-state ()
2825
(vector 'rust-token-base
2926
(list (vector 'top (- rust-indent-unit) nil nil nil))
@@ -300,6 +297,11 @@
300297
(define-key rust-mode-map "}" 'rust-electric-brace)
301298
(define-key rust-mode-map "{" 'rust-electric-brace)
302299

300+
;;;###autoload
301+
(progn
302+
(add-to-list 'auto-mode-alist '("\\.rs$" . rust-mode))
303+
(add-to-list 'auto-mode-alist '("\\.rc$" . rust-mode)))
304+
303305
(provide 'rust-mode)
304306

305307
;;; rust-mode.el ends here

0 commit comments

Comments
 (0)