Small script to set the origin of an object directly in edit mode, without the user have to place manually 3DCursor in editmode, switch to object mode, and set origin-to-cursor.
Code retrieved from https://blenderartists.org/forum/showthread.php?237785-Set-origin-to-selected and mixed with other users sparse code from thread comments. Thanks to original coder(s). Original attribution is in "author" field.
It use Alt-C shortcut or can be called with Spacebar>"Set Origin to Selected"
Generate an error on unregister (does not clean the shortcut?), but it do his job very well, so unregister is not mandatory :D
Very useful and fast.