Subject: [PATCH] Clean up error on wrong major mode in package-menu-mode

From: Stefan Kangas <[email-masked]>
Date: Wed, 23 Oct 2019 18:09:21 +0200

Four package-menu-mode specific commands currently signal an error if
called when not in package-menu-mode.  One of them uses 'user-error',
the others 'error'.  All other commands don't signal an error.

The attached patch makes the behaviour more consistent by:
1) Factoring out the error signalling into a new function to make it
more consistent.
2) Calling this function in all other relevant package-mode-menu commands.

Any comments?

Best regards,
Stefan Kangas