[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/num3-mode fb55297 4/9: * num3-mode.el: Catch strings lo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/num3-mode fb55297 4/9: * num3-mode.el: Catch strings looking like hex number even w/o 0x prefix. |
Date: |
Sat, 28 Nov 2020 18:59:26 -0500 (EST) |
branch: externals/num3-mode
commit fb55297758fd7ab785e2edad804219ce3986be5e
Author: Michal Nazarewicz <mina86@mina86.com>
Commit: Michal Nazarewicz <mina86@mina86.com>
* num3-mode.el: Catch strings looking like hex number even w/o 0x prefix.
Update `num3--number-re' to catch strings which are a whole word, have
only hexadecimal digits and have at least one non-decimal hexadecimal
digit (i.e. letter from A to F), and treat them as hexadecimal number.
Also update `num3--number-re' to properly catch Emacs Lisp's
This fixes bug#16834.
---
num3-mode.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/num3-mode.el b/num3-mode.el
index b890c89..4e4f625 100644
--- a/num3-mode.el
+++ b/num3-mode.el
@@ -4,8 +4,8 @@
;; Author: Felix Lee <felix8a@gmail.com>, Michal Nazarewicz <mina86@mina86.com>
;; Maintainer: Michal Nazarewicz <mina86@mina86.com>
-;; Keywoards: faces, minor-mode
-;; Version: 1.1
+;; Keywords: faces, minor-mode
+;; Version: 1.2
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -98,9 +98,11 @@ where) decimal point (would be) is."
(define-globalized-minor-mode global-num3-mode num3-mode num3-mode)
(defconst num3--number-re
- (concat "\\(?:0[xX]\\|#\\)\\([0-9a-fA-F]+\\)" ; 1 = hexadecimal
- "\\|\\([0-9]+\\)" ; 2 = decimal
- "\\|\\.\\([0-9]+\\)")) ; 3 = fraction
+ (concat "[0#][xX]\\([[:xdigit:]]+\\)" ; 1 = hexadecimal
+ "\\|\\(?1:\\b\\(?:[0-9]+[a-fA-F]\\|" ; 1 = hexadecimal
+ "[a-fA-F]+[0-9]\\)[[:xdigit:]]*\\b\\)"
+ "\\|\\([0-9]+\\)" ; 2 = decimal
+ "\\|\\.\\([0-9]+\\)")) ; 3 = fraction
(defun num3--matcher (lim)
"Function used as a font-lock-keywoard handler used in `num3-mode'.
- [elpa] branch externals/num3-mode created (now 3e82c87), Stefan Monnier, 2020/11/28
- [elpa] externals/num3-mode 207a4ae 1/9: Add num3-mode, Stefan Monnier, 2020/11/28
- [elpa] externals/num3-mode 2bf8ae2 2/9: num3-mode: use “num3--” as prefix for private symbols, Stefan Monnier, 2020/11/28
- [elpa] externals/num3-mode a5064d9 3/9: * num3-mode.el: Fix footer. Reported by Jonas Bernoulli <address@hidden>., Stefan Monnier, 2020/11/28
- [elpa] externals/num3-mode fb55297 4/9: * num3-mode.el: Catch strings looking like hex number even w/o 0x prefix.,
Stefan Monnier <=
- [elpa] externals/num3-mode bb37a10 6/9: * packages/num3-mode/num3-mode.el: Fix compilation warnings., Stefan Monnier, 2020/11/28
- [elpa] externals/num3-mode 8a8924d 5/9: * packages/num3-mode/num3-mode.el (num3-mode): Use font-lock-flush, Stefan Monnier, 2020/11/28
- [elpa] externals/num3-mode 802b61c 8/9: num3-mode: cut new release version 1.3, Stefan Monnier, 2020/11/28
- [elpa] externals/num3-mode 3e82c87 9/9: * .gitignore: New file, Stefan Monnier, 2020/11/28
- [elpa] externals/num3-mode 710466b 7/9: num3-mode: support binary numbers, Stefan Monnier, 2020/11/28