Commit daf6e8c3 authored by Matt Kraai's avatar Matt Kraai

Import elpa-rust-mode_0.3.0.orig.tar.gz

[dgit import orig elpa-rust-mode_0.3.0.orig.tar.gz]
parents
language: generic
env:
matrix:
- EMACS=emacs24
- EMACS=emacs-snapshot
install:
- if [ "$EMACS" = 'emacs24' ]; then
sudo add-apt-repository -y ppa:cassou/emacs &&
sudo apt-get -qq update &&
sudo apt-get -qq -f install &&
sudo apt-get -qq install emacs24 emacs24-el;
fi
- if [ "$EMACS" = 'emacs-snapshot' ]; then
sudo add-apt-repository -y ppa:ubuntu-elisp/ppa &&
sudo apt-get -qq update &&
sudo apt-get -qq -f install &&
sudo apt-get -qq install emacs-snapshot &&
sudo apt-get -qq install emacs-snapshot-el;
fi
script:
- ./run_rust_emacs_tests.sh
notifications:
email: false
This diff is collapsed.
Copyright (c) 2015 The Rust Project Developers
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
`rust-mode`: A major Emacs mode for editing Rust source code
============================================================
`rust-mode` makes editing [Rust](http://rust-lang.org) code with Emacs
enjoyable. `rust-mode` requires Emacs 24 or later.
### Manual Installation
To install manually, check out this repository and add this to your
`.emacs` file:
```lisp
(add-to-list 'load-path "/path/to/rust-mode/")
(autoload 'rust-mode "rust-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
```
This associates `rust-mode` with `.rs` files. To enable it explicitly, do
<kbd>M-x rust-mode</kbd>.
### `package.el` installation via MELPA
It can be more convenient to use Emacs's package manager to handle
installation for you if you use many elisp libraries. If you have
`package.el` but haven't added MELPA, the community
package source, yet, add this to `~/.emacs.d/init.el`:
```lisp
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
```
Then do this to load the package listing:
* <kbd>M-x eval-buffer</kbd>
* <kbd>M-x package-refresh-contents</kbd>
#### Install `rust-mode`
One you have `package.el`, you can install `rust-mode` or any other
modes by choosing them from a list:
* <kbd>M-x package-list-packages</kbd>
Now, to install packages, move your cursor to them and press
<kbd>i</kbd>. This will mark the packages for installation. When
you're done with marking, press <kbd>x</kbd>, and ELPA will install
the packages for you (under `~/.emacs.d/elpa/`).
* or using <kbd>M-x package-install rust-mode</kbd>
### Package installation on Debian testing or unstable
```bash
apt install elpa-rust-mode
```
### Tests via ERT
The file `rust-mode-tests.el` contains tests that can be run via
[ERT](http://www.gnu.org/software/emacs/manual/html_node/ert/index.html).
You can use `run_rust_emacs_tests.sh` to run them in batch mode, if
you set the environment variable EMACS to a program that runs emacs.
## License
`rust-mode` is distributed under the terms of both the MIT license and the
Apache License (Version 2.0).
See [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) for details.
#!/bin/sh
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
#
# This runs the test for emacs rust-mode.
# Either $EMACS must be set, or it must be possible to find emacs via PATH.
if [ -z "$EMACS" ]; then
EMACS=emacs
fi
$EMACS --batch || {
echo "You must set EMACS to a program that runs emacs."
exit 1
}
$( $EMACS -batch > /dev/null 2>&1 ) || {
echo "Your emacs command ($EMACS) does not run properly."
exit 2
};
$( $EMACS -batch --eval "(require 'ert)" > /dev/null 2>&1 ) || {
echo 'You must install the `ert` dependency; see README.md'
exit 3
};
warnings="$( $EMACS -Q -batch -f batch-byte-compile rust-mode.el 2>&1 | grep -v '^Wrote ' )"
if [ -n "$warnings" ]; then
echo "Byte-compilation failed:"
echo "$warnings"
exit 4
else
echo "Byte-compilation passed."
fi
$EMACS -batch -l rust-mode.el -l rust-mode-tests.el -f ert-run-tests-batch-and-exit
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment