diff options
| author | Paul Eggert | 2019-03-10 23:39:48 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-03-10 23:41:21 -0700 |
| commit | 9b4d34fa7884d6b67ec19593c5d2d3b587434966 (patch) | |
| tree | 19231ec9e0ed203dfe4e0192c9f682aace879149 /src | |
| parent | e81c44fdb4110a1e5af97669c1a7ef8277528b6c (diff) | |
| download | emacs-9b4d34fa7884d6b67ec19593c5d2d3b587434966.tar.gz emacs-9b4d34fa7884d6b67ec19593c5d2d3b587434966.zip | |
Improve binary-as-unsigned treatment (Bug#34792)
* etc/NEWS:
* src/editfns.c (Fformat, binary_as_unsigned):
Update now that we always have bignums.
(syms_of_editfns) [!defined lisp_h_FIXNUMP]: Remove now-obsolete
code, since lisp_h_FIXNUMP is always defined now.
* test/src/editfns-tests.el (read-large-integer): Simplify,
now that we can assume binary-as-unsigned defaults to nil.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/editfns.c b/src/editfns.c index f5a9e0a6408..7f11037f1e3 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3001,8 +3001,8 @@ the next available argument, or the argument explicitly specified: | |||
| 3001 | %S means print any object as an s-expression (using `prin1'). | 3001 | %S means print any object as an s-expression (using `prin1'). |
| 3002 | 3002 | ||
| 3003 | The argument used for %d, %o, %x, %e, %f, %g or %c must be a number. | 3003 | The argument used for %d, %o, %x, %e, %f, %g or %c must be a number. |
| 3004 | The value of `binary-as-unsigned' determines whether it's printed as | 3004 | %o, %x, and %X treat arguments as unsigned if `binary-as-unsigned' is t |
| 3005 | signed or unsigned by %o, %x, and %X. | 3005 | (this is experimental; email 32252@debbugs.gnu.org if you need it). |
| 3006 | Use %% to put a single % into the output. | 3006 | Use %% to put a single % into the output. |
| 3007 | 3007 | ||
| 3008 | A %-sequence other than %% may contain optional field number, flag, | 3008 | A %-sequence other than %% may contain optional field number, flag, |
| @@ -4485,17 +4485,13 @@ functions if all the text being accessed has this property. */); | |||
| 4485 | binary_as_unsigned, | 4485 | binary_as_unsigned, |
| 4486 | doc: /* Non-nil means `format' %x and %o treat integers as unsigned. | 4486 | doc: /* Non-nil means `format' %x and %o treat integers as unsigned. |
| 4487 | This has machine-dependent results. Nil means to treat integers as | 4487 | This has machine-dependent results. Nil means to treat integers as |
| 4488 | signed, which is portable; for example, if N is a negative integer, | 4488 | signed, which is portable and is the default; for example, if N is a |
| 4489 | (read (format "#x%x") N) returns N only when this variable is nil. | 4489 | negative integer, (read (format "#x%x") N) returns N only when this |
| 4490 | variable is nil. | ||
| 4490 | 4491 | ||
| 4491 | This variable is experimental; email 32252@debbugs.gnu.org if you need | 4492 | This variable is experimental; email 32252@debbugs.gnu.org if you need |
| 4492 | it to be non-nil. */); | 4493 | it to be non-nil. */); |
| 4493 | /* For now, default to true if bignums exist, false in traditional Emacs. */ | ||
| 4494 | #ifdef lisp_h_FIXNUMP | ||
| 4495 | binary_as_unsigned = false; | 4494 | binary_as_unsigned = false; |
| 4496 | #else | ||
| 4497 | binary_as_unsigned = true; | ||
| 4498 | #endif | ||
| 4499 | 4495 | ||
| 4500 | defsubr (&Spropertize); | 4496 | defsubr (&Spropertize); |
| 4501 | defsubr (&Schar_equal); | 4497 | defsubr (&Schar_equal); |