Skip to content

Commit 18fad39

Browse files
committed
Merge pull request #142 from tromey/remove-emacs-23-support
remove emacs 23 support
2 parents bd44088 + 8400638 commit 18fad39

File tree

4 files changed

+9
-43
lines changed

4 files changed

+9
-43
lines changed

.travis.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@ language: generic
22

33
env:
44
matrix:
5-
- EMACS=emacs23
65
- EMACS=emacs24
76
- EMACS=emacs-snapshot
87

98
install:
10-
- if [ "$EMACS" = 'emacs23' ]; then
11-
sudo apt-get -qq update &&
12-
sudo apt-get -qq -f install &&
13-
sudo apt-get -qq install emacs23-gtk emacs23-el;
14-
fi
159
- if [ "$EMACS" = 'emacs24' ]; then
1610
sudo add-apt-repository -y ppa:cassou/emacs &&
1711
sudo apt-get -qq update &&
@@ -26,14 +20,6 @@ install:
2620
sudo apt-get -qq install emacs-snapshot-el;
2721
fi
2822

29-
# Emacs 23 does not come with ERT. Download it and have emacs find it
30-
before_script:
31-
- if [ "$EMACS" = 'emacs23' ]; then
32-
curl -Os https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el &&
33-
export EMACSLOADPATH=$(emacs -batch -eval "(princ (mapconcat 'identity load-path \":\"))") &&
34-
export EMACSLOADPATH="$EMACSLOADPATH:$PWD";
35-
fi
36-
3723
script:
3824
- ./run_rust_emacs_tests.sh
3925

README.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
============================================================
33

44
`rust-mode` makes editing [Rust](http://rust-lang.org) code with Emacs
5-
enjoyable.
6-
5+
enjoyable. `rust-mode` requires Emacs 24 or later.
76

87
### Manual Installation
98

@@ -38,14 +37,6 @@ Then do this to load the package listing:
3837
* <kbd>M-x eval-buffer</kbd>
3938
* <kbd>M-x package-refresh-contents</kbd>
4039

41-
If you use a version of Emacs prior to 24 that doesn't include
42-
`package.el`, you can get it from [here](http://git.savannah.gnu.org/gitweb/?p=emacs.git;a=blob_plain;hb=ba08b24186711eaeb3748f3d1f23e2c2d9ed0d09;f=lisp/emacs-lisp/package.el).
43-
44-
If you have an older ELPA `package.el` installed from tromey.com, you
45-
should upgrade in order to support installation from multiple sources.
46-
The ELPA archive is deprecated and no longer accepting new packages,
47-
so the version there (1.7.1) is very outdated.
48-
4940
#### Install `rust-mode`
5041

5142
One you have `package.el`, you can install `rust-mode` or any other
@@ -73,11 +64,6 @@ The file `rust-mode-tests.el` contains tests that can be run via
7364
You can use `run_rust_emacs_tests.sh` to run them in batch mode, if
7465
you set the environment variable EMACS to a program that runs emacs.
7566

76-
To test it under emacs 23, which does not ship with ERT, download ert.el from
77-
https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el
78-
and put it in a place where emacs can find it. (ERT has shipped with emacs
79-
since emacs 24.)
80-
8167
## License
8268

8369
`rust-mode` is distributed under the terms of both the MIT license and the

rust-mode-tests.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,8 +2524,9 @@ Fontification needs to include this whole string or none of it.
25242524
;; no error--the tests will be skipped.
25252525
(require 'elec-pair nil t)
25262526

2527-
;; The emacs 23 version of ERT does not have test skipping functionality. So
2528-
;; don't even define these tests if elec-pair is not available.
2527+
;; The emacs 23 and 24 versions of ERT do not have test skipping
2528+
;; functionality. So don't even define these tests if elec-pair is
2529+
;; not available.
25292530
(when (featurep 'elec-pair)
25302531
(defun test-electric-pair-insert (original point-pos char closer)
25312532
(let ((old-electric-pair-mode electric-pair-mode))

rust-mode.el

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
;; Author: Mozilla
55
;; Url: https://github.com/rust-lang/rust-mode
66
;; Keywords: languages
7+
;; Package-Requires: ((emacs "24.0"))
78

89
;; This file is distributed under the terms of both the MIT license and the
910
;; Apache License (version 2.0).
@@ -530,11 +531,7 @@ function or trait. When nil, where will be aligned with fn or trait."
530531
(defun rust-re-item-def (itype)
531532
(concat (rust-re-word itype) "[[:space:]]+" (rust-re-grab rust-re-ident)))
532533

533-
;; (See PR #42 -- this is just like `(regexp-opt words 'symbols)` from
534-
;; newer Emacs versions, but will work on Emacs 23.)
535-
(defun regexp-opt-symbols (words)
536-
(concat "\\_<" (regexp-opt words t) "\\_>"))
537-
(defconst rust-re-special-types (regexp-opt-symbols rust-special-types))
534+
(defconst rust-re-special-types (regexp-opt rust-special-types 'symbols))
538535

539536

540537
(defun rust-path-font-lock-matcher (re-ident)
@@ -558,10 +555,10 @@ the desired identifiers), but does not match type annotations \"foo::<\"."
558555
(append
559556
`(
560557
;; Keywords proper
561-
(,(regexp-opt-symbols rust-mode-keywords) . font-lock-keyword-face)
558+
(,(regexp-opt rust-mode-keywords 'symbols) . font-lock-keyword-face)
562559

563560
;; Special types
564-
(,(regexp-opt-symbols rust-special-types) . font-lock-type-face)
561+
(,(regexp-opt rust-special-types 'symbols) . font-lock-type-face)
565562

566563
;; The unsafe keyword
567564
("\\_<unsafe\\_>" . 'rust-unsafe-face)
@@ -1266,18 +1263,14 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
12661263
(interactive)
12671264
(setq-local rust-format-on-save nil))
12681265

1269-
;; For compatibility with Emacs < 24, derive conditionally
1270-
(defalias 'rust-parent-mode
1271-
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
1272-
12731266
(defvar rust-mode-map
12741267
(let ((map (make-sparse-keymap)))
12751268
(define-key map (kbd "C-c C-f") 'rust-format-buffer)
12761269
map)
12771270
"Keymap for Rust major mode.")
12781271

12791272
;;;###autoload
1280-
(define-derived-mode rust-mode rust-parent-mode "Rust"
1273+
(define-derived-mode rust-mode prog-mode "Rust"
12811274
"Major mode for Rust code.
12821275
12831276
\\{rust-mode-map}"

0 commit comments

Comments
 (0)