Skip to main content


I have come to the conclusion that #Emacs' documentation on how to build multi-file packages is all lies.

screwlisp reshared this.

in reply to Jonathan Lamothe

As a side note, can any #Emacs wizards explain to me why this package won't install?
cloud.jlamothe.net/index.php/s…
#AskFedi

reshared this

in reply to Jonathan Lamothe

FWIW it seems to be complaining that the package description is nil. Two things about this:

  1. define-package lists this argument as optional.
  2. It's supplied anyway.
in reply to Jonathan Lamothe

• (eepitch-shell)
cd foo
tar xvf testpackage-0-0.tar
• (add-to-list 'load-path "~/foo/testpackage-0.0")
• (load "testpackage")
• (apropos "testpackage")
=>
testpackage-func is an interactive Lisp function in ‘testpackage.el’.

(testpackage-func)

A test function

[back]works on my machine
@sacha

in reply to screwlisp

@screwlisp @Sacha Chua When I try to install it with M-x package-install-file it gives me:

Wrong type argument: stringp, nil

When I use the debugger it seems to be caused by it thinking the package description is nil? I'll try to dig deeper.

in reply to Jonathan Lamothe

Ah, yeah, I thought a little bit more and you weren't actually saying I-want-to-load-this-file. I guess the concept of a package in emacs lisp does not resemble common lisp at all. I.e. a symbol doesn't have a package like a lisp symbol does. Packaging refers to packaging e.g. a mode for distribution, right? At which point I think we would refer to e.g. melpa github.com/melpa/melpa?tab=rea… about what melpa wants you to do. That's my 25 cents anyway.
@sacha
in reply to screwlisp

@screwlisp @Sacha Chua Yeah, I can build simple packages, but the description for how to build a multi-file package seems not to work.

Most packages are distributed in the simple format, but if you want to include a manual for instance, you need a multi-file package.

in reply to Jonathan Lamothe

If we look at Xahlee's site here: xahlee.info/emacs/emacs/elisp_… he notes that
"The terms “Package” and “Library” do not have technical meaning in elisp.

The term “module” is not used by emacs."

} really, we are concerned with writing modes for emacs. Packaging them for distribution means meeting the package-source's requirements for the mode to be built and then distributed from a git, e.g.. That is my other 25 cents ;p.

in reply to screwlisp

This is different to #commonLisp in which I might
CL-USER> (uiop:define-package foo)
#<"FOO" package>
CL-USER> (in-package foo)
#<"FOO" package>
FOO> (defvar bar)
BAR
FOO> (export 'bar)
T

} this is not an emacs idiom. Similarly, common lisp does not have a notion of interaction major and minor modes like emacs does. I guess package in emacs means something similar to system in the de facto asdf sense in common lisp. In my opinion this collision is confusing.

in reply to Jonathan Lamothe

it feels like you're manually creating a .tar like what would be in an ELPA, but you can submit things to NonGNU ELPA or MELPA as a recipe, which can include your .texi manual if you want. github.com/melpa/melpa/blob/ma… emacsredux.com/blog/2021/08/11… . Before inclusion in one of those repos, people can also install it manually or with use-package :vc or package-vc-install: gnu.org/software/emacs/manual/…
in reply to Sacha Chua

@Sacha Chua @screwlisp Yeah, that's essentially what I'm trying to do. My eventual goal is to create my own semi-private ELPA archive, mostly because I don't want to bother people with having to review my probably terrible novice code before including it in their archives. 🙃

None of this code is really ready for public consumption yet. It's more of a learning exercise.

in reply to Jonathan Lamothe

I picked a trivial multifile package example, seq:
Tree: gitweb.git.savannah.gnu.org/gi…
A package of three files, seq.el, seq-24.el and seq-25.el, and if you are in emacs 25 or later, seq.el requires seq-25 or seq-24 otherwise. Presumably your multi-file elisp project should meaningfully resemble seq e.g. with the conventional package headers.

Then, I think you are basically looking for quelpa: github.com/quelpa/quelpa
@sacha

This entry was edited (4 hours ago)
in reply to screwlisp

@screwlisp @Sacha Chua What's interesting is that this package seems to be lacking a seq-pkg.el file. 🤔

Edit: Wait, it's in .gitignore?

Is it being auto generated somehow?

in reply to Jonathan Lamothe

Yes, you don't write that stuff. []. You just write your major/minor modes as normal, and your headers provide metadata that is used by package sources to generate the package tars.
@sacha
This entry was edited (3 hours ago)
in reply to screwlisp

as we can see in
> (directory "~/.emacs.d/elpa/seq-2.24/*.*")
(#P"~/.emacs.d/elpa/seq-2.24/seq.elc"
#P"~/.emacs.d/elpa/seq-2.24/seq-25.elc"
#P"~/.emacs.d/elpa/seq-2.24/seq-24.elc"
#P"~/.emacs.d/elpa/seq-2.24/seq-autoloads.el"
#P"~/.emacs.d/elpa/seq-2.24/seq-25.el"
#P"~/.emacs.d/elpa/seq-2.24/seq-pkg.el"
#P"~/.emacs.d/elpa/seq-2.24/seq.el"
#P"~/.emacs.d/elpa/seq-2.24/seq-24.el")
if you will forgive some of the-other-lisp ;p
@sacha
in reply to screwlisp

@screwlisp @Sacha Chua What I'm curious about is how it made the determination that seq.el was the main file. This is fairly obvious with my human intuition. Was it just because all the other .el files started with seq-, or was it doing something more fancy by looking at the contents of the files and seeing what requited what?

Edit: Ah, I bet it has to do with the fact that only seq.el had ;; Package: and ;; Version: lines, which explicitly set the package name (and version).

in reply to Jonathan Lamothe

I thought maybe it needed to be in some GNU variant of the tar format for Emacs to be able to read it, but when I just open the tar file directly in Emacs I get a directory listing and can read all the files, so that's not it.
in reply to Jonathan Lamothe

Ah. I assume that this would live somewhere near the top of my testpackage.el file?

Edit: Looking at other examples, it tends to be found at the bottom.

This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.