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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode 2e800ee 151/486: workaround emacs 23 issues.


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 2e800ee 151/486: workaround emacs 23 issues.
Date: Sat, 7 Aug 2021 09:25:08 -0400 (EDT)

branch: elpa/rust-mode
commit 2e800ee9c8a38619dfdf58d03e6c4d5381f61196
Author: Felix S. Klock II <pnkfelix@pnkfx.org>
Commit: Felix S. Klock II <pnkfelix@pnkfx.org>

    workaround emacs 23 issues.
---
 rust-mode.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rust-mode.el b/rust-mode.el
index 6df4ffc..27250a2 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -326,14 +326,19 @@
 (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) "\\_>"))
+
 (defvar rust-mode-font-lock-keywords
   (append
    `(
      ;; Keywords proper
-     (,(regexp-opt rust-mode-keywords 'symbols) . font-lock-keyword-face)
+     (,(regexp-opt-symbols rust-mode-keywords) . font-lock-keyword-face)
 
      ;; Special types
-     (,(regexp-opt rust-special-types 'symbols) . font-lock-type-face)
+     (,(regexp-opt-symbols rust-special-types) . font-lock-type-face)
 
      ;; Attributes like `#[bar(baz)]` or `#![bar(baz)]` or `#[bar = "baz"]`
      (,(rust-re-grab (concat "#\\!?\\[" rust-re-ident "[^]]*\\]"))



reply via email to

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