Skip to main content
dalanicolai's user avatar
dalanicolai's user avatar
dalanicolai's user avatar
dalanicolai
  • Member for 5 years
  • Last seen more than a month ago
comment
No output in Python inferior buffer after C-c C-c
I've updated the answer with an 'alternative' solution.
revised
No output in Python inferior buffer after C-c C-c
add 'better' solution for quickly running the program
Loading…
Loading…
revised
Loading…
comment
How do I learn which key prefix a keymap is bound to?
Okay, good find. I have updated the answer with some alternative solution.
revised
How do I learn which key prefix a keymap is bound to?
add alternative solution in response to comments
Loading…
revised
Loading…
comment
How do I learn which key prefix a keymap is bound to?
@artem If you can find "C-x h" using where-is-internal on help-map, it probably means you have 'bound' help-map by making it a command (assigning the help-map to its function cell). From emacs -q you can try (where-is-internal 'help-command) and it will return some non-nil value, while doing it for help-map returns nil. If you inspect where-is then you will find that it uses where-is-internal 'internally'. A weird thing is that replacing where-is with where-is-internal in the answer's code returns nil. But probably the reason for that can be found by further inspection.
Loading…
Loading…
Loading…
comment
How do you convert a vector of float numbers to bytes?
That's a nice 'round-up' of the answer/question. Of course the IEEE-float-2-hex function also switches from number to string representation, it would be nice to just modify that function directly to make it return numbers instead of the hex string. But indeed it is probably not worth the extra time if you have the working solution already.
Loading…
revised
Loading…
Loading…
comment
How do you convert a vector of float numbers to bytes?
@JohnKitchin Would it be okay to simply use that python code and read it back into Emacs (i.e. pass it to a python script and read its output)? That is a very easy solution, I would already have the code ready for you. Or do you really prefer a pure elisp implementation? E.g. those numbers you get in python using the following line print(' '.join([f'{b:d}' for b in pack('f', 3.14)]) + '\n'). The script reads from stdin and prints to stdout.
comment
How to pretty print my emacs configuration with literate programming?
The best way to format the code, is by formatting it while writing it. You can do this by opening the code block in a 'special edit buffer'. With the cursor on the code block, press C-c C-' to open it in the special edit buffer, press it again to update and jump back to the src-block. This answer gives a few more tricks. Of course, it should not be too difficult to fully automate this if you know some lisp, but I am not aware of an existing solution yet.
comment
How to pretty print my emacs configuration with literate programming?
Pretty print to what/where? Only the code or also the text?
comment
How do you convert a vector of float numbers to bytes?
Ah okay, I see. I will have to read up on number/byte representations:)
comment
How do you convert a vector of float numbers to bytes?
Ah, I did not realize that I had to configure the radix first using M-x calc-binary-radix (or M-x calc-hex-radix if you prefer). Calc and its documentation is somewhat of a black box to me.
1
5 6
7
8 9
83