[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 866df37 196/486: make rust-mode use lexical bind
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 866df37 196/486: make rust-mode use lexical binding |
Date: |
Sat, 7 Aug 2021 09:25:17 -0400 (EDT) |
branch: elpa/rust-mode
commit 866df37ca517ccdb381d1e431dd5dff52e303430
Author: Tom Tromey <tom@tromey.com>
Commit: Tom Tromey <tom@tromey.com>
make rust-mode use lexical binding
Emacs 24 introduces lexical binding, which should be preferred for new
code. This enables it for rust-mode. The code continues to work fine
on pre-24 Emacs, and it won't be difficult for this to remain true. One
concrete advantage of lexical binding is that it lets the byte-compiler
generate better warnings in some cases; here it found a couple of unused
variables.
---
rust-mode.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/rust-mode.el b/rust-mode.el
index ff6814b..4ba4c7c 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1,4 +1,4 @@
-;;; rust-mode.el --- A major emacs mode for editing Rust source code
+;;; rust-mode.el --- A major emacs mode for editing Rust source code
-*-lexical-binding: t-*-
;; Version: 0.2.0
;; Author: Mozilla
@@ -12,7 +12,8 @@
(eval-when-compile (require 'misc)
(require 'rx)
- (require 'compile))
+ (require 'compile)
+ (require 'url-vars))
(defvar electric-pair-inhibit-predicate)
@@ -1102,7 +1103,7 @@ This is written mainly to be used as
`end-of-defun-function' for Rust."
(progn
(goto-char (match-beginning 0))
;; Go to the closing brace
- (condition-case err
+ (condition-case nil
(forward-sexp)
(scan-error
;; The parentheses are unbalanced; instead of being unable to
fontify, just jump to the end of the buffer
@@ -1175,7 +1176,7 @@ This is written mainly to be used as
`end-of-defun-function' for Rust."
(error-or-warning "\\(?:[Ee]rror\\|\\([Ww]arning\\)\\)"))
(let ((re (concat "^" file ":" start-line ":" start-col
": " end-line ":" end-col
- " \\(?:[Ee]rror\\|\\([Ww]arning\\)\\):")))
+ " " error-or-warning ":")))
(cons re '(1 (2 . 4) (3 . 5) (6)))))
"Specifications for matching errors in rustc invocations.
See `compilation-error-regexp-alist' for help on their format.")
- [nongnu] elpa/rust-mode 8d99bf8 126/486: Merge pull request #31 from pnkfelix/more-robust-test-driver, (continued)
- [nongnu] elpa/rust-mode 8d99bf8 126/486: Merge pull request #31 from pnkfelix/more-robust-test-driver, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e16c37c 161/486: Remove Marmalade from the README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ee171df 172/486: test $EMACS directly rather than using "which", ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d1ed015 173/486: Distinguish face for doc-comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c9c7871 179/486: Merge pull request #79 from MicahChalmer/angle-bracket-madness, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ee564d5 185/486: Merge pull request #85 from talchas/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 99b128c 187/486: Fix slowness in angle bracket matching, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5e77aed 191/486: Correcting highlighting of capitals in function names., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5e51aaa 194/486: Merge pull request #69 from tromey/safe-local-variables, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 012537b 195/486: remove byte-compiler warnings and prevent future ones, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 866df37 196/486: make rust-mode use lexical binding,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 6252cf1 217/486: Fix indentation of closing delimiters, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode dd6d417 215/486: Fix type annotations incorrectly highlighted as modules., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 86d636a 223/486: Remove duplicate keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b1cca0f 222/486: Merge pull request #72 from birkenfeld/builtin-face, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 061e6d8 214/486: Merge pull request #109 from mrBliss/highlight-unsafe, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 86c55b1 220/486: Integrate rustfmt support, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode beec95a 231/486: Allow disabling rustfmt with a dir-local/file-local variable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6739dd9 226/486: Merge pull request #123 from birkenfeld/fix-unicode-char-escapes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f408b06 227/486: Run the after-revert hook after rustfmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode bc0df03 235/486: Merge pull request #135 from Stebalien/file-local, ELPA Syncer, 2021/08/07