in a few lines using existing functionality, as replacement for the autocrop plugin. Rename the existing "crop" actions to "crop-to-selection".