* define-package, use-package and recipe: which ones?
@ 2024-11-30 6:49 Marco Antoniotti
2024-11-30 19:14 ` Stefan Monnier via Users list for the GNU Emacs text editor
0 siblings, 1 reply; 6+ messages in thread
From: Marco Antoniotti @ 2024-11-30 6:49 UTC (permalink / raw)
To: help-gnu-emacs
Hi
I am (almost) ready to post a couple of packages to elpa/melpa, but I am by
now confused about what to put in the top level folder.
I understand that eventually I will need a recipe.el file form elpa/melpa,
but I read that define-package is deprecated and I am not clear about the
use of use-package.
What exactly do you need nowadays?
Since I am notoriously lazy I thought of asking directly here for
enlightenment.
Thank you
All the best
MA
P.S. Here are the packages github repos.
https://github.com/marcoxa/platel
https://github.com/marcoxa/magiciel
--
Marco Antoniotti
Somewhere over the Rainbow
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: define-package, use-package and recipe: which ones?
2024-11-30 6:49 Marco Antoniotti
@ 2024-11-30 19:14 ` Stefan Monnier via Users list for the GNU Emacs text editor
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-11-30 19:14 UTC (permalink / raw)
To: help-gnu-emacs
> I am (almost) ready to post a couple of packages to elpa/melpa, but I am by
> now confused about what to put in the top level folder.
The main ELisp file of your package, using the recommended format for
ELisp files, and in which you make sure to include a `Version:` header
an `Author:` header (or `Maintainer:`), as well as (if needed)
a `Package-Requires:` header.
The MELPA/(Non)GNU ELPA scripts will take care to generate the
`<PKG>-pkg.el` from that (which will contain a `package-define` form).
Stefan
PS: `use-package` is something only loosely related.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: define-package, use-package and recipe: which ones?
@ 2024-12-01 8:43 Marco Antoniotti
2024-12-01 9:17 ` Rudolf Schlatte
2024-12-03 13:44 ` Stefan Monnier via Users list for the GNU Emacs text editor
0 siblings, 2 replies; 6+ messages in thread
From: Marco Antoniotti @ 2024-12-01 8:43 UTC (permalink / raw)
To: help-gnu-emacs
Thank you Stefan
So. I do not need to do anything (except remove my -pkg.el file from the
repo).
Other questions:
1. where should I put the 'recipe' file?
2. what is `use-package` used for then?
3. One of the two packages I want to submit builds an emacs module; any
suggestions about how to package it?
Thanks
--
Marco Antoniotti
Somewhere over the Rainbow
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: define-package, use-package and recipe: which ones?
2024-12-01 8:43 define-package, use-package and recipe: which ones? Marco Antoniotti
@ 2024-12-01 9:17 ` Rudolf Schlatte
2024-12-01 14:14 ` Philip Kaludercic
2024-12-03 13:44 ` Stefan Monnier via Users list for the GNU Emacs text editor
1 sibling, 1 reply; 6+ messages in thread
From: Rudolf Schlatte @ 2024-12-01 9:17 UTC (permalink / raw)
To: help-gnu-emacs
Marco Antoniotti <marcoxa@gmail.com> writes:
> 2. what is `use-package` used for then?
It's an alternative way for loading packages, replacing many forms with
one. Its use is optional; some people like it. Instead of writing
this:
(add-to-list 'load-path "~/Source/foo-mode")
(add-to-list 'auto-mode-alist '("\\.foo\\'" . foo-mode))
(autoload #'foo-mode "foo-mode" nil t)
(setq foo-extras t)
you can write this:
(use-package foo-mode
:load-path "~/Source/foo-mode"
:commands (foo-mode)
:mode "\\.foo\\'"
:custom (foo-extras t))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: define-package, use-package and recipe: which ones?
2024-12-01 9:17 ` Rudolf Schlatte
@ 2024-12-01 14:14 ` Philip Kaludercic
0 siblings, 0 replies; 6+ messages in thread
From: Philip Kaludercic @ 2024-12-01 14:14 UTC (permalink / raw)
To: Rudolf Schlatte; +Cc: help-gnu-emacs
Rudolf Schlatte <rudi@constantly.at> writes:
> Marco Antoniotti <marcoxa@gmail.com> writes:
>
>> 2. what is `use-package` used for then?
>
> It's an alternative way for loading packages,
... and installing in a declarative way.
> replacing many forms with
> one. Its use is optional; some people like it. Instead of writing
> this:
>
> (add-to-list 'load-path "~/Source/foo-mode")
> (add-to-list 'auto-mode-alist '("\\.foo\\'" . foo-mode))
> (autoload #'foo-mode "foo-mode" nil t)
> (setq foo-extras t)
>
> you can write this:
>
> (use-package foo-mode
> :load-path "~/Source/foo-mode"
> :commands (foo-mode)
> :mode "\\.foo\\'"
Where it is worth pointing out that these fields are usually not
necessary any more, as well-written packages tend to have autoloads that
include adjustments to `load-path' and similar variables.
> :custom (foo-extras t))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: define-package, use-package and recipe: which ones?
2024-12-01 8:43 define-package, use-package and recipe: which ones? Marco Antoniotti
2024-12-01 9:17 ` Rudolf Schlatte
@ 2024-12-03 13:44 ` Stefan Monnier via Users list for the GNU Emacs text editor
1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-03 13:44 UTC (permalink / raw)
To: help-gnu-emacs
Marco Antoniotti [2024-12-01 09:43:02] wrote:
> So. I do not need to do anything (except remove my -pkg.el file from the
> repo).
That's right, assuming you already have an `Author:` (or `Maintainer:`)
with a valid email address, and you maintain a `Version:` header
as well.
> 1. where should I put the 'recipe' file?
What recipe file? If you're referring to the data used to tell where to
find your repository, that's something maintained on the side of the
ELPA archive (e.g. Melpa or (Non)GNU ELPA) and each archive does
it differently.
> 2. what is `use-package` used for then?
It's an alternative style to write Emacs init files.
> 3. One of the two packages I want to submit builds an emacs module; any
> suggestions about how to package it?
I'd suggest you look at [libpq](http://elpa.gnu.org/packages/pq.html),
which is a package with similar needs (and with virtually zero ELisp
code of its own). It all starts in the `pq.el` file which doesn't do
much more than arrange to compile the module.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-12-03 13:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-01 8:43 define-package, use-package and recipe: which ones? Marco Antoniotti
2024-12-01 9:17 ` Rudolf Schlatte
2024-12-01 14:14 ` Philip Kaludercic
2024-12-03 13:44 ` Stefan Monnier via Users list for the GNU Emacs text editor
-- strict thread matches above, loose matches on Subject: below --
2024-11-30 6:49 Marco Antoniotti
2024-11-30 19:14 ` Stefan Monnier via Users list for the GNU Emacs text editor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).