Thank you. So, basically for *resource* files (i.e. not Elisp) and something unrelated to Info there are no real reasons to avoid subdirectories, right? As long as one can generate packages as expected (probably not with MELPA, though maybe there is some hidden feature in it for this), they will work fine and one could e.g. do something like `(defvar ... (somehow-load-resource "foo/bar.baz"))'?

Paul

On Sat, 15 May 2021 at 21:40, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> is it possible/well-defined to have subdirectories in Elisp packages?

Yes.

> E.g.  in MELPA documentation I see that "Any file specified at any
> path in the repository is copied to the root of the package".
> Is there a good reason for it, or is it rather a limitation of MELPA?

It's a limitation of MELPA linked to a limitation of ELPA.
IIRC the main limitation in this respect in ELPA is that the
`<pkg->-autoloads.el` file created during installation only collects
autoload cookies from .el files in the package's main directory.
Another related one is that the package's Texinfo doc is expected to
come with the `.info` and a `dir` files in the root dir.

You can partly circumvent those issues if you create your own autoloads
file somehow (either before packaging the tarball, or as part of the
byte-compilation performed after installation) and/or set the
`Info-directory-list` yourself (from the autoloads file, presumably).


        Stefan