diff options
| author | William Xu | 2014-06-19 17:08:44 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-06-19 17:08:44 -0400 |
| commit | da20e0f1a8ab6b4c0713b237315dd1bd383f8f76 (patch) | |
| tree | 0932cd26b712b1163ae979705b02a57d5cfa2958 | |
| parent | 27966b81010f96a4031c6f696f155a693d69dd60 (diff) | |
| download | emacs-da20e0f1a8ab6b4c0713b237315dd1bd383f8f76.tar.gz emacs-da20e0f1a8ab6b4c0713b237315dd1bd383f8f76.zip | |
* lisp/progmodes/hideif.el (hif-string-to-number): Don't return float for
hex integer constants.
Fixes: debbugs:17807
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/hideif.el | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1bc768a3b52..d8146a96312 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-06-19 William Xu <william.xwl@gmail.com> | ||
| 2 | |||
| 3 | * progmodes/hideif.el (hif-string-to-number): Don't return float for | ||
| 4 | hex integer constants (bug#17807). | ||
| 5 | |||
| 1 | 2014-06-19 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2014-06-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * international/mule-util.el (truncate-string-ellipsis): New var. | 8 | * international/mule-util.el (truncate-string-ellipsis): New var. |
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index bcb46592465..ee144df4395 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el | |||
| @@ -412,9 +412,13 @@ that form should be displayed.") | |||
| 412 | (if (or (not base) (= base 10)) | 412 | (if (or (not base) (= base 10)) |
| 413 | (string-to-number string base) | 413 | (string-to-number string base) |
| 414 | (let* ((parts (split-string string "\\." t "[ \t]+")) | 414 | (let* ((parts (split-string string "\\." t "[ \t]+")) |
| 415 | (frac (cadr parts)) | 415 | (frac (cadr parts)) |
| 416 | (quot (expt (* base 1.0) (length frac)))) | 416 | (quot (expt (* base 1.0) (length frac))) |
| 417 | (/ (string-to-number (concat (car parts) frac) base) quot)))) | 417 | (num (/ (string-to-number (concat (car parts) frac) base) |
| 418 | quot))) | ||
| 419 | (if (= num (truncate num)) | ||
| 420 | (truncate num) | ||
| 421 | num)))) | ||
| 418 | 422 | ||
| 419 | (defun hif-tokenize (start end) | 423 | (defun hif-tokenize (start end) |
| 420 | "Separate string between START and END into a list of tokens." | 424 | "Separate string between START and END into a list of tokens." |