[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-x C-e on numbers
From: |
Stephen Leake |
Subject: |
Re: C-x C-e on numbers |
Date: |
Thu, 04 Dec 2014 10:47:14 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt) |
address@hidden (Alfred M. Szmidt) writes:
> Currently, when evaluating a number, emacs will print the decimal,
> octal, hexadecimal, and charachter of said number.
>
> 42 C-x C-e ==> 42 (#o52, #x2a, ?*)
>
> It would be useful, if the output would also include the binary
> representation of the number. Or at least somehow enable such
> behaviour. I.e.,
>
> 42 C-x C-e ==> 42 (#b101010, #o52, #x2a, ?*)
I often need to examine binary; currently, I shell out to an Ada
executable that does it for me.
But I'm already annoyed at how many representations are shown, so I'd
rather just make it available; I can always do
M-: (show-binary 42)
or something similar.
gdb uses the format letter "t" for binary; ideally, I'd like to see that
in elisp format; then I could do:
(format "%t" 42) ==> #b101010
That covers all the possible combinations of input and output format.
But I suspect that means adding it to the underlying standard C library,
which isn't going to happen.
--
-- Stephe