Skip to content

Commit bc77e16

Browse files
committed
remove emacs 23 support
This removes the various Emacs 23 compatibility hacks. Fixes #137. Fixes #139. This also obsoletes PR #141.
1 parent bd44088 commit bc77e16

File tree

3 files changed

+7
-28
lines changed

3 files changed

+7
-28
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

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: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,7 @@ function or trait. When nil, where will be aligned with fn or trait."
530530
(defun rust-re-item-def (itype)
531531
(concat (rust-re-word itype) "[[:space:]]+" (rust-re-grab rust-re-ident)))
532532

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))
533+
(defconst rust-re-special-types (regexp-opt rust-special-types 'symbols))
538534

539535

540536
(defun rust-path-font-lock-matcher (re-ident)
@@ -558,10 +554,10 @@ the desired identifiers), but does not match type annotations \"foo::<\"."
558554
(append
559555
`(
560556
;; Keywords proper
561-
(,(regexp-opt-symbols rust-mode-keywords) . font-lock-keyword-face)
557+
(,(regexp-opt rust-mode-keywords 'symbols) . font-lock-keyword-face)
562558

563559
;; Special types
564-
(,(regexp-opt-symbols rust-special-types) . font-lock-type-face)
560+
(,(regexp-opt rust-special-types 'symbols) . font-lock-type-face)
565561

566562
;; The unsafe keyword
567563
("\\_<unsafe\\_>" . 'rust-unsafe-face)
@@ -1266,18 +1262,14 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
12661262
(interactive)
12671263
(setq-local rust-format-on-save nil))
12681264

1269-
;; For compatibility with Emacs < 24, derive conditionally
1270-
(defalias 'rust-parent-mode
1271-
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
1272-
12731265
(defvar rust-mode-map
12741266
(let ((map (make-sparse-keymap)))
12751267
(define-key map (kbd "C-c C-f") 'rust-format-buffer)
12761268
map)
12771269
"Keymap for Rust major mode.")
12781270

12791271
;;;###autoload
1280-
(define-derived-mode rust-mode rust-parent-mode "Rust"
1272+
(define-derived-mode rust-mode prog-mode "Rust"
12811273
"Major mode for Rust code.
12821274
12831275
\\{rust-mode-map}"

0 commit comments

Comments
 (0)