emacs-elpa-diffs
[Top][All Lists]
Advanced

[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.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]