Code Monkey home page Code Monkey logo

0xc's People

Contributors

adamniederer avatar celeritascelery avatar dcluna avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

0xc's Issues

Convert all the numbers in the buffer

Do you think if it's useful to provide a function that converts all the hex numbers in the buffer to decimal numbers?
For example, something like 0xc-convert-buffer that converts

<tag1>0x4</tag1>
<tag2>0x3</tag2>
<tag3>0x1 0x2 0x3<tag3>

to

<tag1>4</tag1>
<tag2>3</tag2>
<tag3>1 2 3<tag3>

I imagine this can be done by re-search-forward for 0x[0-9a-f]+ and call 0xc-convert-point?

Mode-sensitive number base cycling?

I was looking for a command like M-x number-base-at-point-cycle. If I'm in c-mode and I have 0123 (octal) at point, it would convert it to 83 (decimal). If I then used the command a second time, it would convert the number to 0x53 (hex). A third time, back to 0123 (octal). If I'm in nasm-mode it would know that NASM also has 0b1010 syntax for binary literals so it would cycle through that as well. If I used the command in lisp-mode it would know that Lisp spells numbers like #x-123 (hex) and would do the same thing in a mode-sensitive fashion. This command could then be used in keyboard macros to convert many numbers at once. Actually we could have:

  • number-base-at-point-to-binary
  • number-base-at-point-to-octal
  • number-base-at-point-to-decimal
  • number-base-at-point-to-hex
  • number-base-at-point-cycle

Each of them could take an optional prefix argument to specify the number of digits in the resulting number, so the result would be padded with leading zeros where needed.

Do you think such a command would be a good fit for this package, or too different?

Attempting conversion fails with a type error in 0xc-string-to-number

Hi,

I tried using 0xc after installing it from MELPA. I tried to do a simple conversion of the number 10 to hexadecimal, just to get a feel for how this works. However, everything I try seems to end up with this error:

0xc-string-to-number: Wrong type argument: stringp, nil

This error occurs when I try 0xc-convert-point as well. I'm not sure whether I'm just using this package incorrectly or if this is a bug. In either case, there's not enough documentation here for me to tell. FYI, I'm using Emacs 25.1.1 on OS X 10.11.6.

No description available.

In the package listing (M-x list-packages) this package is missing it's description.

You should add something like this into the comments at top of the file:

;;; 0xc.el --- Base 10 number conversion utility.

Improve README with examples?

I think it would be great to have an example section in the README file. So people can get to know this great package easier! Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.