diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2017-11-18 12:29:41 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2017-11-18 12:29:41 +0200 |
commit | 29520b083f4bddbf5f7d3bbf0b3d30f31025f4f8 (patch) | |
tree | 74d997cab4adf4810741ed5b292704597cf12d0f /lisp | |
parent | 3e801240986af911e5d97828a2743b04237c9f9c (diff) | |
download | emacs-29520b083f4bddbf5f7d3bbf0b3d30f31025f4f8.tar.gz |
Fix quick-calc in C mode with hex values
* lisp/calc/calc-aent.el (math-read-token): Make sure the match
against "0[xX][0-9a-fA-F]+" is found at math-exp-pos. See
http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00174.html
for the details.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/calc/calc-aent.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index f70a6d0eb07..997ac3d583f 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -728,7 +728,9 @@ in Calc algebraic input.") math-exp-str (1- math-exp-pos)) (1- math-exp-pos)))))) (or (and (memq calc-language calc-lang-c-type-hex) - (string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos)) + (eq (string-match "0[xX][0-9a-fA-F]+" math-exp-str + math-exp-pos) + math-exp-pos)) (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?" math-exp-str math-exp-pos)) (setq math-exp-token 'number |