[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nasm-mode 2259c7d 34/67: Properly distinguish word and sym
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nasm-mode 2259c7d 34/67: Properly distinguish word and symbol constituents. |
Date: |
Sun, 29 Aug 2021 11:23:48 -0400 (EDT) |
branch: elpa/nasm-mode
commit 2259c7d698afaf49d4a8d490f980707e2d479a4d
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Properly distinguish word and symbol constituents.
Using backward-kill-word was behaving inconsistently with other modes.
Characters like _ should be symbol constituents, not word constituents.
Use superword-mode to override this, just as in other modes.
---
nasm-mode.el | 36 +++++++++++++++++-------------------
1 file changed, 17 insertions(+), 19 deletions(-)
diff --git a/nasm-mode.el b/nasm-mode.el
index 63e870c..43fece5 100644
--- a/nasm-mode.el
+++ b/nasm-mode.el
@@ -537,17 +537,17 @@
"NASM preprocessor directives (pptok.c) for `nasm-mode'."))
(defconst nasm-label-regexp
- "\\(\\<[a-zA-Z_.?][a-zA-Z0-9_$#@~.?]*\\>\\)\\s-*:"
+ "\\(\\_<[a-zA-Z_.?][a-zA-Z0-9_$#@~.?]*\\_>\\)\\s-*:"
"Regexp for `nasm-mode' for matching labels.")
(defconst nasm-constant-regexp
- "\\<$?[-+0-9][-+_0-9A-Fa-fHhXxDdTtQqOoBbYyeE.]*\\>"
+ "\\_<$?[-+0-9][-+_0-9A-Fa-fHhXxDdTtQqOoBbYyeE.]*\\_>"
"Regexp for `nasm-mode' for matching numeric constants.")
(defmacro nasm--opt (keywords)
"Prepare KEYWORDS for `looking-at'."
`(eval-when-compile
- (regexp-opt ,keywords 'words)))
+ (regexp-opt ,keywords 'symbols)))
(defconst nasm-imenu-generic-expression
`((nil ,(concat "^\\s-*" nasm-label-regexp) 1)
@@ -556,7 +556,7 @@
"Expressions for `imenu-generic-expression'.")
(defconst nasm-font-lock-keywords
- `(("\\<\\.[a-zA-Z0-9_$#@~.?]+\\>" . font-lock-type-face)
+ `(("\\_<\\.[a-zA-Z0-9_$#@~.?]+\\_>" . font-lock-type-face)
(,(nasm--opt nasm-registers) . 'nasm-registers)
(,(nasm--opt nasm-prefix) . 'nasm-prefix)
(,(nasm--opt nasm-types) . 'nasm-types)
@@ -568,21 +568,19 @@
"Keywords for `nasm-mode'.")
(defconst nasm-mode-syntax-table
- (let ((table (make-syntax-table)))
- (prog1 table
- (modify-syntax-entry ?_ "w" table)
- (modify-syntax-entry ?# "w" table)
- (modify-syntax-entry ?@ "w" table)
- (modify-syntax-entry ?\. "w" table)
- (modify-syntax-entry ?\? "w" table)
- (modify-syntax-entry ?# "w" table)
- (modify-syntax-entry ?@ "w" table)
- (modify-syntax-entry ?~ "w" table)
- (modify-syntax-entry ?\; "<" table)
- (modify-syntax-entry ?\n ">" table)
- (modify-syntax-entry ?\" "\"" table)
- (modify-syntax-entry ?\' "\"" table)
- (modify-syntax-entry ?\` "\"" table)))
+ (with-syntax-table (copy-syntax-table)
+ (modify-syntax-entry ?_ "_")
+ (modify-syntax-entry ?# "_")
+ (modify-syntax-entry ?@ "_")
+ (modify-syntax-entry ?\? "_")
+ (modify-syntax-entry ?~ "_")
+ (modify-syntax-entry ?\. "w")
+ (modify-syntax-entry ?\; "<")
+ (modify-syntax-entry ?\n ">")
+ (modify-syntax-entry ?\" "\"")
+ (modify-syntax-entry ?\' "\"")
+ (modify-syntax-entry ?\` "\"")
+ (syntax-table))
"Syntax table for `nasm-mode'.")
(defvar nasm-mode-map
- [nongnu] elpa/nasm-mode 2a5768a 16/67: Indent commented code differently., (continued)
- [nongnu] elpa/nasm-mode 2a5768a 16/67: Indent commented code differently., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode f357905 19/67: Fix up README., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode a715d4e 22/67: Use sharp quote in call-interactively., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 9f05280 23/67: Adjust package description., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode e641c8a 24/67: Flesh out a little more commentary., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode f62c103 25/67: Add preprocessor directives:, ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 2940e4f 27/67: Run all regexp-opt at compile time (faster loads)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 6e208d5 29/67: Indent single-commented lines differently., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode e015f41 30/67: Split out types, like word, dword, qword, etc., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 42ee760 32/67: Allow to change faces used by nasm-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 2259c7d 34/67: Properly distinguish word and symbol constituents.,
ELPA Syncer <=
- [nongnu] elpa/nasm-mode e978f6e 35/67: Don't use 3-argument <= (requires 24.4)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode d95a12d 45/67: Add section name highlighting back., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 64e450d 54/67: Allow inserting tabs immediately after a mnemonic, ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 8ce1831 55/67: Use nasm-basic-offset instead of a literal 8, ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode e9acee3 09/67: Expand the syntax table for labels., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode e53433c 10/67: Better label font lock matching., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 23cb9de 20/67: Add imenu support for macro definitions., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 2c87509 36/67: Correct boundaries in syntax highlighting., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 78818f1 39/67: Remove a few more garbage "instructions.", ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 1127620 44/67: Fix breakage caused by recent regexp changes., ELPA Syncer, 2021/08/29