If you wish to use the package manager for this (which is entirely reasonable -- it will take care of byte-compilation, ensure all the autoloads are processed, etc), then:
Copy the package (somewhere that isn't in your Emacs load-path
) and make whatever changes you wish to make.
If it is a simple package built from a single .el
file (ignoring *.elc
, *-pkg.el
, and *-autoloads.el
files):
If it is a complex package built from multiple files:
Update the version string in the *-pkg.el
file
If you're running Emacs 25+, invoke package-install-file
on the directory.
If you're running Emacs 24, create a tar file of the directory (include the directory itself; not just its contents), and invoke package-install-file
on the tar file.
You should be able to safely delete the unnecessary files from your modified source for the package (e.g. *.elc
, *-autoloads.el
, and for the simple package case, *-pkg.el
).
See C-hig (elisp) Packaging
for more information.