@@ -530,11 +530,7 @@ function or trait. When nil, where will be aligned with fn or trait."
530
530
(defun rust-re-item-def (itype )
531
531
(concat (rust-re-word itype) " [[:space:]]+" (rust-re-grab rust-re-ident)))
532
532
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 ))
538
534
539
535
540
536
(defun rust-path-font-lock-matcher (re-ident )
@@ -558,10 +554,10 @@ the desired identifiers), but does not match type annotations \"foo::<\"."
558
554
(append
559
555
`(
560
556
; ; Keywords proper
561
- (,(regexp-opt-symbols rust-mode-keywords) . font-lock-keyword-face )
557
+ (,(regexp-opt rust-mode-keywords 'symbols ) . font-lock-keyword-face )
562
558
563
559
; ; Special types
564
- (,(regexp-opt-symbols rust-special-types) . font-lock-type-face )
560
+ (,(regexp-opt rust-special-types 'symbols ) . font-lock-type-face )
565
561
566
562
; ; The unsafe keyword
567
563
(" \\ _<unsafe\\ _>" . 'rust-unsafe-face )
@@ -1266,18 +1262,14 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
1266
1262
(interactive )
1267
1263
(setq-local rust-format-on-save nil ))
1268
1264
1269
- ; ; For compatibility with Emacs < 24, derive conditionally
1270
- (defalias 'rust-parent-mode
1271
- (if (fboundp 'prog-mode ) 'prog-mode 'fundamental-mode ))
1272
-
1273
1265
(defvar rust-mode-map
1274
1266
(let ((map (make-sparse-keymap )))
1275
1267
(define-key map (kbd " C-c C-f" ) 'rust-format-buffer )
1276
1268
map)
1277
1269
" Keymap for Rust major mode." )
1278
1270
1279
1271
;;;### autoload
1280
- (define-derived-mode rust-mode rust-parent -mode " Rust"
1272
+ (define-derived-mode rust-mode prog -mode " Rust"
1281
1273
" Major mode for Rust code.
1282
1274
1283
1275
\\ {rust-mode-map}"
0 commit comments