Skip to content

leaf-handler-vc: Add package to package-selected-packages#552

Merged
conao3 merged 1 commit intoconao3:masterfrom
uwabami:master
Mar 2, 2026
Merged

leaf-handler-vc: Add package to package-selected-packages#552
conao3 merged 1 commit intoconao3:masterfrom
uwabami:master

Conversation

@uwabami
Copy link
Contributor

@uwabami uwabami commented Feb 4, 2026

Description

The :vc handler (leaf-handler-vc) previously only called package-vc-install but did not update package-selected-packages. This caused packages installed via :vc to be flagged as orphaned by package-autoremove.

This commit adds a leaf-safe-push call to leaf-handler-vc, aligning its behavior with leaf-handler-package. This ensures that VC-installed packages are correctly registered in the in-memory session, preventing them from being unexpectedly removed during package cleanup.

;; Before
(leaf-handler-vc bbdb (bbdb (:url "..." :lisp-dir "...")))
;; => (unless (package-installed-p 'bbdb) (package-vc-install '(bbdb ...) nil))
;; After
(leaf-handler-vc bbdb (bbdb (:url "..." :lisp-dir "...")))
;; => (progn
;;      (leaf-safe-push 'bbdb package-selected-packages 'no-dup)
;;      (unless (package-installed-p 'bbdb) (package-vc-install '(bbdb ...) nil)))

Checklist

  • I've read CONTRIBUTING.org.
    • I've assign FSF. -> I alerady send e-mail, wating response.
    • The leaf.el after my changed pass all testcases by make test.
    • My changed elisp code byte-compiled cleanly.
    • I've added testcases related to my PR.
      • No. Because current test suites do not check for leaf handler-* macro expansion.
    • I've fixed README related the my added testcases.
      • No. Because I didn't add any test casees.

The `:vc` handler (`leaf-handler-vc`) previously only called
`package-vc-install` but did not update `package-selected-packages`.
This caused packages installed via `:vc` to be flagged as orphaned
by `package-autoremove`.

This commit adds a `leaf-safe-push` call to `leaf-handler-vc`,
aligning its behavior with `leaf-handler-package`.
This ensures that VC-installed packages are correctly registered
in the in-memory session, preventing them from being unexpectedly
removed during package cleanup.

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
@uwabami
Copy link
Contributor Author

uwabami commented Feb 28, 2026

Checklist

  • I've read CONTRIBUTING.org.
    • I've assign FSF. -> I alerady send e-mail, wating response. done!
    • The leaf.el after my changed pass all testcases by make test.
    • My changed elisp code byte-compiled cleanly.
    • I've added testcases related to my PR.
      • No. Because current test suites do not check for leaf handler-* macro expansion.
    • I've fixed README related the my added testcases.
      • No. Because I didn't add any test casees.

@conao3
Copy link
Owner

conao3 commented Mar 2, 2026

@uwabami Thanks!

@conao3 conao3 merged commit b49e686 into conao3:master Mar 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants