[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Transient Showcase Update
From: |
Psionic K |
Subject: |
Transient Showcase Update |
Date: |
Sun, 19 Jan 2025 10:31:04 +0900 |
Brief intro: Transient is a package underlying Magit, Casual, as well
as interfaces for GPTel and many others. The Transient showcase is a
literate org guide with code examples to supplement the Transient
manual and aid progression through various forms and standalone
examples to demonstrate behaviors. The repo's README describes how to
use the package or literate org doc, from which the package and README
are generated.
I've added examples focused on pure Elisp program use cases eg with no
downstream CLI being controlled. Pure Elisp programs benefit from a
strategy of integrating more directly with basic idiomatic Elisp
facilities like defvar and persisting state in a file. This
alleviates the "overkill" problem others have described when trying to
push Elisp state through Transient's CLI-specific state display and
persistence facilities.
The new section on "Ad-Hoc Elisp State" contains an example of how to
control a buffer local (the mode line format), how to use defvar with
a `:description' function, and how to persist application settings
independently of customize. "Ad-hoc" here means without special
support from Transient. Direct Link to new section:
https://github.com/positron-solutions/transient-showcase?tab=readme-ov-file#ad-hoc-elisp-state
CLI programs have a lot of state display and persistence support built
into transient. Elisp programs mostly don't require or benefit much
from these, and that's why other package authors and I have
independently arrived at heavy reliance on `:description' and `:info'
to display regular Elisp states that exist in simple defvar and
defcustom forms.
The persistence example demonstrates use of a dedicated file that is
not dependent on Customize. This is important for Elisp programs that
need to persist state but for which Transient's CLI-focused
persistence is unnecessary indirection.
It's not yet an ideal integration with interactive forms and keymaps,
but through a simple style change, we arrive at some pretty easy,
pretty powerful context-specific interfaces that display state and
provide modal bindings to specific use cases.
Thanks to Jonas for work on the `:info` class to provide a convenient
layout option for display-only information.
I've noticed several commits made in the Github network of forks for
which no PRs were ever submitted. Please at least file an issue so I
can integrate these changes. I don't test every single example
through each version of Transient.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Transient Showcase Update,
Psionic K <=