progfolio / elpaca

An elisp package manager
GNU General Public License v3.0
634 stars 31 forks source link

[Support]: Upgrading Elpaca, Installing packages sans use-package #205

Closed doctorguile closed 10 months ago

doctorguile commented 10 months ago

Hi,

First, I really like this package, have been using since version 0.5 for a while.

Check the github page and see that it's now 0.6 and some of the commands mentioned in the readme is different than what I have so trying to update to 0.6 to make sure I have the latest version before asking for help.

First documentation issue: it's not obvious how to upgrade/update elpaca itself.

Saw this open issue https://github.com/progfolio/elpaca/issues/155 and I followed the instruction

M-x elpaca-delete elpaca

I make sure my init.el bootstrap code is updated from the previous

(defvar elpaca-installer-version 0.5) ... (elpaca `(,@elpaca-order))

to

;; copied from readme (defvar elpaca-installer-version 0.6) ... (elpaca `(,@elpaca-order))

then I restart emacs

elpaca reinstalls itself just fine. but all my other packages won't load

elpaca finished ✓ 0.044 secs 00.063671 rainbow-mode failed Unable to determine repo dir: (error "Cannot determine URL from recipe: (:protocol https :inherit t :depth 1 :demand t :autoloads t :package \"rainbow-mode\")") 00.153893 magit failed Unable to determine repo dir: (error "Cannot determine URL from recipe: (:protocol https :inherit t :depth 1 :demand t :autoloads t :package \"magit\")") 00.158529 ...

Note that I'm not using elpaca-use-package / (elpaca-use-package-mode) , just raw elpaca

Previously when I was using elpaca 0.5 I am specifying the package I want to use like this

(elpaca '(magit :demand t :autoloads t))

second documentation issue:

For people that is not using the use-package integration, it is not entirely obvious from the doc how to specify package to install by just looking at the manual

https://github.com/progfolio/elpaca/blob/master/doc/manual.md

I am still not entirely sure how to go from the “burger” package recipe to installing a package

(defun elpaca-example-menu (_) '((burger . (:recipe ( :buns 2 :lettuce t :tomato t :beef t :cheese t :cook well-done :from elpaca-example-menu)))))

Maybe my meta programming skill is lacking, but at least in version 0.5, I tried many times until I figure out the form

(elpaca '(magit :demand t :autoloads t))

to install a package :)

Not trying to criticize the doc, just trying to help to spread the love to other emacs users who are not familiar with the elpaca DSL language

Now in version 0.6 seems that that form is giving the error as shown above.

Thanks

Operating System

macos

Description

proper procedure to upgrade from old version of elpaca to latest.

how to write elisp code in init.el to install package using elpaca (but not using use-package integration)

progfolio commented 10 months ago

Hi,

First, I really like this package, have been using since version 0.5 for a while.

Hi. Thanks for giving it a shot and taking the time to fill out a support ticket.

First documentation issue: it's not obvious how to upgrade/update elpaca itself.

Elpaca is queued like any other package, so the commands which update packages will work.

Saw this open issue https://github.com/progfolio/elpaca/issues/155 and I followed the instruction

M-x elpaca-delete elpaca

Deleting Elpaca shouldn't usually be necessary unless the repository ends up in a state where those commands don't work. The following should usually work:

  1. M-x elpaca-fetch elpaca
  2. M-x elpaca-merge elpaca
  3. Restart Emacs

Elpaca reinstalls itself just fine. but all my other packages won't load (error "Cannot determine URL from recipe:...

The menu-item cache format changed recently. This is not something that will change often (if ever again). For a solution, see: https://github.com/progfolio/elpaca/issues/188

Previously when I was using elpaca 0.5 I am specifying the package I want to use like this

(elpaca '(magit :demand t :autoloads t))

:demand is a use-package keyword, and has no effect in an Elpaca recipe. Normally, you shouldn't have to specify :autoloads t, either. That value is implied unless otherwise specified. (elpaca magit) should do.

For people that is not using the use-package integration, it is not entirely obvious from the doc how to specify package to install by just looking at the manual

https://github.com/progfolio/elpaca/blob/master/doc/manual.md

I am still not entirely sure how to go from the “burger” package recipe to installing a package

(defun elpaca-example-menu (_) '((burger . (:recipe ( :buns 2 :lettuce t :tomato t :beef t :cheese t :cook well-done :from elpaca-example-menu)))))

If you have a menu which offers a "burger" item, the following will use the menu's recipe:

(elpaca burger) ;;install the "burger" package

You may find this comment useful, too: https://github.com/progfolio/elpaca/issues/203#issuecomment-1817335022

Does that help?

doctorguile commented 10 months ago

deleting $ELPACA-DIR/cache/menu-items.eld and restarting Emacs.

This fixed it. Sorry I was only looking at open issue and missed 188. Seems like its worth adding this to the FAQ of readme that might help with support.

:demand is a use-package keyword, and has no effect in an Elpaca recipe. Normally, you shouldn't have to specify :autoloads t, either. That value is implied unless otherwise specified. (elpaca magit) should do.

You may find this comment useful, too: https://github.com/progfolio/elpaca/issues/203#issuecomment-1817335022

Thanks for the help.

In general, I think having some straight forward examples for the following cases in the readme would greatly help any new comer to this awesome package (the current doc is too abstract/meta)

  1. Load a package from MELPA
  2. Load a package from GNU-devel ELPA
  3. Load a package by git clone via ssh/https (straight.el use case)
  4. Load specific git commit hash of a package
  5. Load your own fork of a git repo and also how to keep track of upstream
  6. Load a package, and control what files/subdirectory within the package should be ignore (blacklist)
  7. Load a package, and control what files/subdirectory within the package should be load and ignore others (whitelist)

1 & 2 Seems to be just (elpaca package-name)

3 example (elpaca `(sqlite3 :autoloads t :protocol https :host github :repo "pekingduck/emacs-sqlite3-api"))

4 ??

5 example (elpaca `(anki-editor :autoloads t :protocol ssh :host github :repo "your-own-fork/anki-editor" :remotes (("origin" :repo "your-own-fork/anki-editor") ("fork" :repo "orgtre/anki-editor"))))

6 & 7 ??

BTW I saw this warning in emacs 29.1, is it because transient is now part of emacs core already?

⛔ Warning (emacs): transient loaded before Elpaca activation

Thanks!

progfolio commented 10 months ago

deleting $ELPACA-DIR/cache/menu-items.eld and restarting Emacs.

This fixed it. Sorry I was only looking at open issue and missed 188. Seems like its worth adding this to the FAQ of readme that might help with support.

That specific issue won't happen unless the menu item cache changes in a breaking way. I don't plan on doing that. There's a section in the wiki which covers that error:

https://github.com/progfolio/elpaca/wiki/Warnings-and-Errors#unable-to-determine-recipe-url

In general, I think having some straight forward examples for the following cases in the readme would greatly help any new comer

1 Load a package from MELPA 2 Load a package from GNU-devel ELPA 3 Load a package by git clone via ssh/https (straight.el use case) 4 Load specific git commit hash of a package 5 Load your own fork of a git repo and also how to keep track of upstream 6 Load a package, and control what files/subdirectory within the package should be ignore (blacklist) 7 Load a package, and control what files/subdirectory within the package should be load and ignore others (whitelist)

Elpaca installs and activates packages so they can be loaded. Loading is handled by explicitly by require or implicitly by evaling an autoload.

1 & 2) Seems to be just (elpaca package-name)

Assuming the desired menu is the first entry in elpaca-menu-functions to return a matching menu item for package-name, yes. To ensure a specific menu is used, the :inherit keyword can take a menu function symbol. e.g.

;;MELPA
(elpaca package-name :inherit elpaca-menu-melpa)
;;GNU ELPA
(elpaca package-name :inherit elpaca-menu-gnu-elpa)

2 example (elpaca `(sqlite3 :autoloads t :protocol https :host github :repo "pekingduck/emacs-sqlite3-api"))

Again, I don't recommend specifying :autoloads t unless you have reason to. This is the default, as is the https :protocol.

3 ??

I'm not sure what you're asking for with 3. Do you mean, installing a package which is not hosted in an ELPA? e.g.

(elpaca (package-name :host github :repo "user/repo-name"))

Or do you mean a git repository on the local filesystem?:

(elpaca (package-name :repo "/path/to/repo"))

4 ... 7

Recipe keywords are all covered in the recipes section of the manual. e.g. To check out an exact commit, the :ref example shows the following recipe:

(example :host github :repo "user/example" :ref "a76ca0a") ;; Check out a specific commit.

The examples aren't passed to the elpaca macro because they're not valid packages. People have a tendency to copy/paste/eval code blindly and the orders will fail.

In general, I'd prefer to keep the README short. I've added a basic example to the example init.el file. Tutorials and the like are a better candidate for the wiki.

BTW I saw this warning in emacs 29.1, is it because transient is now part of emacs core already?

⛔ Warning (emacs): transient loaded before Elpaca activation

Please keep issues focused on one topic in the future. It makes it easier to search and refer to them. I've added a wiki section concerning that warning which should help explain it:

https://github.com/progfolio/elpaca/wiki/Warnings-and-Errors#feature-loaded-early

doctorguile commented 10 months ago

Thanks for taking the time to respond.

Agreed that wiki is a great place for additional documentation.

Have a great day!