Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What is the shortcut to run inline tests in emacs?


Asked by Magnus Carson on Dec 03, 2021 FAQ



The shortcut C-c C-c C-c will run the test at point. Very handy to run inline tests and to not always have switch back-and-forth between a terminal and Emacs. C-c C-p opens a popup buffer that will give you similar access to the commands shown above but will stick around.
Keeping this in consideration,
Emacs will display the exit code of the terminating command in the mode line if it is non-zero. Any output sent to standard error will be interspersed as though it came from standard out; if you want it sent to its own buffer you must set shell-command-default-error-buffer to the name of a buffer you want it sent to.
In respect to this, To use it, you can invoke either shell-command-on-region or its shortcut, M-|. The marked text is sent, verbatim, to the shell command and its output. If you want Emacs to replace the region with the output returned from the command, you should prefix the command with the universal argument, C-u.
Consequently,
The asynchronous version will use the buffer *Async Shell Command* for its output. If you prefix the command with the universal argument, C-u, Emacs will insert the output of the shell command into the current buffer at point. This feature is a god send, for mostly obvious reasons.
Besides,
The rksm/emacs-rust-config github repo contains a standalone.el file that you can use to start Emacs with: $ git clone https://github.com/rksm/emacs-rust-config $ emacs -q --load./emacs-rust-config/standalone.el This will start Emacs with an.emacs.d directory set to the location of the checked out repository (and a different elpa directory).