about summary refs log tree commit diff
path: root/src/etc/emacs/rust-mode.el
AgeCommit message (Collapse)AuthorLines
2015-01-29Pull configs out into individual repositoriesSteve Klabnik-520/+0
As we grow, these don't belong in-tree. http://internals.rust-lang.org/t/moving-editor-highlighting-into-their-own-repos/1395 * https://github.com/rust-lang/rust.vim * https://github.com/rust-lang/rust-mode * https://github.com/rust-lang/gedit-config * https://github.com/rust-lang/kate-config * https://github.com/rust-lang/nano-config * https://github.com/rust-lang/zsh-config
2015-01-21rollup merge of #19913: KOMON/rust-mode-emacs-indentationAlex Crichton-3/+30
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
2015-01-20Changed rust-mode code for tabs -> spacesDaniel Raloff-20/+20
2015-01-09Mark _ as a word constituent to avoid highlighting parts of identifiers as ↵Sean Gillespie-0/+5
keywords
2015-01-07Update editor syntax files for isize/usize.Huon Wilson-1/+1
Yay, syntax highlighting.
2014-12-16added optional method chain indentations for emacs major modeDaniel Raloff-1/+28
2014-12-14Update emacs and vi modes.Niko Matsakis-1/+1
2014-11-16rust-mode.el: Tweak syntax tableRoy Crihfield-4/+1
"_" should keep the default syntax class (symbol, not word). This allows, e.g., `forward-word' to behave in the familiar way, jumping to underscores within a function or variable name.
2014-11-10Add 'move' keyword to emacs, kate, and vim editor modes.Sean Gillespie-1/+1
2014-08-17Add new keywords (particularly `where` & `virtual`) to editor modes.Huon Wilson-2/+3
2014-06-17emacs: Don't overwrite font lock for attributesTom Jakubowski-1/+1
This addresses the font lock regression introduced by the earlier pull request #14818 - attributes are no longer be highligted inside of comments and strings. Also add some font lock test infrastructure and some tests for attribute font locking.
2014-06-17auto merge of #14818 : tomjakubowski/rust/emacs-attributes-key-value, r=pnkfelixbors-3/+3
This addresses two problems noted in #14347: the highlight of `#foo]` as an attribute, and the non-highlight of `#[foo = "bar"]`.
2014-06-16Update repo locationBrian Anderson-1/+1
2014-06-11emacs: highlight `#[foo = "bar"]` attributesTom Jakubowski-2/+2
Setting `OVERRIDE` to `t` overrides the conflicting highlight Emacs places on string literals. Fix #14347
2014-06-11emacs: do not highlight `#foo]` as an attributeTom Jakubowski-1/+1
part of #14347
2014-05-12emacs: highlight `macro_name!` in macro invocations using [] delimitersHuon Wilson-1/+1
2014-05-03Use defvar for rust-top-item-beg-re insteadPhil Ruffwind-5/+5
Since rust-top-item-beg-re hasn't been defined yet, using defvar instead of setq is more appropriate here (and also silences compilation warnings).
2014-05-02emacs: Add 'box' to keywordsBrian Anderson-1/+1
2014-04-09rust-mode cleanup.Rüdiger Sonderfeld-51/+58
* Use `setq-local' instead of (set (make-local-variable ...) value). Provides a version for older Emacsen. * Remove use of `cl.el'. * Use \' in file regexp instead of line end match $. * Use type for defcustom and add parent group.
2014-04-04etc: attempts at fixing editor highlighting for new attribute syntaxCorey Richardson-1/+1
2014-04-03Update emacs mode to support new `#![inner(attribute)]` syntax.Felix S. Klock II-2/+2
2014-03-12Emacs: always jump the cursor if needed on indentMicah Chalmer-8/+8
The rust-mode-indent-line function had a check, which ran after all the calculations for how to indent had already happened, that skipped actually performing the indent if the line was already at the right indentation. Because of that, the cursor did not jump to the indentation if the line wasn't changing. This was particularly annoying if there was nothing but spaces on the line and you were at the beginning of it--it looked like the indent just wasn't working. This removes the check and adds test cases to cover this.
2014-02-22Emacs: indent relative to enclosing blockMicah Chalmer-37/+63
This changes the indent to calculate positions relative to the enclosing block (or braced/parenthesized expression), rather than by an absolute nesting level within the whole file. This allows things like this to work: let x = match expr { Pattern => ... } With the old method, only one level of nesting would be added within the match braces, so "Pattern" would have ended up aligned with the match. The other change is that multiple parens/braces on the same line only increase the indent once. This is a very common case for passing closures/procs. The absolute nesting method would do this: spawn(proc() { // Indented out two indent levels... }) whereas the code in this commit does this: spawn(proc() { // Indented out only one level... })
2014-02-22Emacs: stay at the correct position when indentingMicah Chalmer-8/+8
When indenting a non-blank line, stay at the same cursor position relative to the content after indenting.
2014-02-22Fix emacs indentation of multi-line match patternsMicah Chalmer-3/+2
Aligns to the same column if the previous line ends in a single '|' (but not a '||').
2014-02-14extern mod => extern crateAlex Crichton-3/+2
This was previously implemented, and it just needed a snapshot to go through
2014-02-14Add crate to emacs and kate modefilesKevin Ballard-0/+1
2013-12-31Fix rust-align-to-expr-after-brace, closes #11239.John Louis Walker-1/+3
forward-to-word is undefined, and so Emacs would throw errors in rust-align-to-expr-after-brace. This change yields the expected behavior discussed in the issue.
2013-12-14Add "proc" as keyword to emacs modeMicah Chalmer-1/+1
2013-12-09Add defun motions for rust-mode.S Pradeep Kumar-1/+43
Specifically, we can now use: + beginning-of-defun + end-of-defun + mark-defun where "defun" means a Rust item. + Add tests in rust-mode-tests.el + Fix indentation in rust-mode-tests.el + Add support for trait to Imenu
2013-12-04Add Imenu support for rust-mode.S Pradeep Kumar-18/+33
+ Delete trailing whitespace.
2013-09-28Fix single-line-style paragraph fills with code immediately before or afterMicah Chalmer-1/+2
2013-09-26Add 'continue' keyword to emacs, vim, gedit, kateBrian Anderson-0/+1
2013-09-07Fix regression of multi-line statement indentsMicah Chalmer-23/+24
2013-09-06Add paragraph fill and auto-fill for multi-line commentsMicah Chalmer-1/+123
2013-09-06Add custom group for rust-modeMicah Chalmer-1/+5
2013-09-06Indent return type to align with argumentsMicah Chalmer-2/+5
2013-09-06Allow indenting to align struct fields after curly braceMicah Chalmer-17/+14
2013-09-06Indent correctly after opening square bracketMicah Chalmer-1/+1
2013-09-05Fix glitches with struct field aligned indentsMicah Chalmer-2/+2
2013-08-30Align field names in struct expressions with fields on same line as the ↵Micah Chalmer-4/+14
opening curly brace
2013-08-30Multiline comments with leading *s line up the *sMicah Chalmer-0/+4
2013-08-29One indent after open paren with no argumentMicah Chalmer-2/+8
2013-08-29Correct indent with trailing spaces/comments on previous lineMicah Chalmer-2/+3
2013-08-28rust-mode: Default rust-indent-offset to 4, not default-tab-widthAnders Kaseorg-5/+3
default-tab-width is standardly 8, but most programmers and style guides prefer an indentation width smaller than that. Rust itself uses 4 space indents. Most other Emacs modes define the indentation width as 4 or 2 spaces, independently of the width of a Tab character. Depending on default-tab-width makes especially little sense for rust-mode because it sets indent-tabs-mode to nil. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-08-27fix typo in rust-mode.elFelix S. Klock II-1/+1
2013-08-26extend file regexp to match files with embedded spaces.Felix S. Klock II-1/+1
2013-08-25revisions to emacs compilation regexp, more readable and robust.Felix S. Klock II-7/+15
2013-08-25compilation error regexp specific to rustc.Felix S. Klock II-0/+15
Fix #6887.
2013-08-08rust-mode: make indentation customizablePaul Collins-6/+11
Add new variable rust-indent-offset, defaulting to the old value, and use it.