branch: elpa/rust-mode
commit bc77e168478d0588b238f06c9c8301992b605044
Author: Tom Tromey <[email protected]>
Commit: Tom Tromey <[email protected]>
remove emacs 23 support
This removes the various Emacs 23 compatibility hacks.
Fixes #137.
Fixes #139.
This also obsoletes PR #141.
---
.travis.yml | 14 --------------
rust-mode-tests.el | 5 +++--
rust-mode.el | 16 ++++------------
3 files changed, 7 insertions(+), 28 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 04231a7..2b6e3fb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,16 +2,10 @@ language: generic
env:
matrix:
- - EMACS=emacs23
- EMACS=emacs24
- EMACS=emacs-snapshot
install:
- - if [ "$EMACS" = 'emacs23' ]; then
- sudo apt-get -qq update &&
- sudo apt-get -qq -f install &&
- sudo apt-get -qq install emacs23-gtk emacs23-el;
- fi
- if [ "$EMACS" = 'emacs24' ]; then
sudo add-apt-repository -y ppa:cassou/emacs &&
sudo apt-get -qq update &&
@@ -26,14 +20,6 @@ install:
sudo apt-get -qq install emacs-snapshot-el;
fi
-# Emacs 23 does not come with ERT. Download it and have emacs find it
-before_script:
- - if [ "$EMACS" = 'emacs23' ]; then
- curl -Os
https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el
&&
- export EMACSLOADPATH=$(emacs -batch -eval "(princ (mapconcat 'identity
load-path \":\"))") &&
- export EMACSLOADPATH="$EMACSLOADPATH:$PWD";
- fi
-
script:
- ./run_rust_emacs_tests.sh
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index a99d36b..2c0431c 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -2524,8 +2524,9 @@ Fontification needs to include this whole string or none
of it.
;; no error--the tests will be skipped.
(require 'elec-pair nil t)
-;; The emacs 23 version of ERT does not have test skipping functionality. So
-;; don't even define these tests if elec-pair is not available.
+;; The emacs 23 and 24 versions of ERT do not have test skipping
+;; functionality. So don't even define these tests if elec-pair is
+;; not available.
(when (featurep 'elec-pair)
(defun test-electric-pair-insert (original point-pos char closer)
(let ((old-electric-pair-mode electric-pair-mode))
diff --git a/rust-mode.el b/rust-mode.el
index c770f61..42a1cfb 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -530,11 +530,7 @@ function or trait. When nil, where will be aligned with
fn or trait."
(defun rust-re-item-def (itype)
(concat (rust-re-word itype) "[[:space:]]+" (rust-re-grab rust-re-ident)))
-;; (See PR #42 -- this is just like `(regexp-opt words 'symbols)` from
-;; newer Emacs versions, but will work on Emacs 23.)
-(defun regexp-opt-symbols (words)
- (concat "\\_<" (regexp-opt words t) "\\_>"))
-(defconst rust-re-special-types (regexp-opt-symbols rust-special-types))
+(defconst rust-re-special-types (regexp-opt rust-special-types 'symbols))
(defun rust-path-font-lock-matcher (re-ident)
@@ -558,10 +554,10 @@ the desired identifiers), but does not match type
annotations \"foo::<\"."
(append
`(
;; Keywords proper
- (,(regexp-opt-symbols rust-mode-keywords) . font-lock-keyword-face)
+ (,(regexp-opt rust-mode-keywords 'symbols) . font-lock-keyword-face)
;; Special types
- (,(regexp-opt-symbols rust-special-types) . font-lock-type-face)
+ (,(regexp-opt rust-special-types 'symbols) . font-lock-type-face)
;; The unsafe keyword
("\\_<unsafe\\_>" . 'rust-unsafe-face)
@@ -1266,10 +1262,6 @@ This is written mainly to be used as
`end-of-defun-function' for Rust."
(interactive)
(setq-local rust-format-on-save nil))
-;; For compatibility with Emacs < 24, derive conditionally
-(defalias 'rust-parent-mode
- (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
-
(defvar rust-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c C-f") 'rust-format-buffer)
@@ -1277,7 +1269,7 @@ This is written mainly to be used as
`end-of-defun-function' for Rust."
"Keymap for Rust major mode.")
;;;###autoload
-(define-derived-mode rust-mode rust-parent-mode "Rust"
+(define-derived-mode rust-mode prog-mode "Rust"
"Major mode for Rust code.
\\{rust-mode-map}"