emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Installing binaries with package.el


From: Stefan Monnier
Subject: Re: Installing binaries with package.el
Date: Tue, 07 Feb 2017 11:05:23 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> Can package.el install binaries?  That is, if my package includes a command
> line interface, can I ask package.el to install it to somewhere like
> .emacs.d/bin, or ~/.bin?  Or should I do this by adding autoloaded code that
> runs at package installation time?

package.el installs packages using a very simple procedure:
- untar the package into ~/.emacs.d/elpa/<pkg>-<vers>
- create the autoloads file.
- byte-compile the .el files.

If you want to do something else, you have to abuse one of the above
steps, and the only one that can be abused reliably is the byte-compile
step.  E.g. you can place in one of the .el files something like

    (eval-when-compile
      ...copy some file to ~/bin...)

The same trick can be used by pdf-tools and dynloaded modules.
But obviously, package.el should be extended to support this more directly.

In your case the problem of course, is that when uninstalling a package,
the procedure is even simpler:
- rm -r ~/.emacs.d/elpa/<pkg>-<vers>
and I don't know of any way to abuse this to also remove something you
might have added to ~/bin.

Notice that this second problem doesn't affect cases such as dynloaded
modules or pdf-tools.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]