Replies: 1 comment 1 reply
-
Answering that will require that I do some experimentation and since I am focused on wrapping things up, you'll have to wait for that until next year. Merry Christmas and Happy New year 🎆 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I've been playing around with alternative implementations of a feature for my project that involves modifying the
transient-suffix
command
slot, but I appear to have hit a blocker with figuring out how to actually replace it. I'm wondering now if there is a better path to what I'm trying to do, or maybe if this should be a feature request instead.Background
The intention in this case is to essentially be able to add advice or wrap the command such that behaviors may be changed depending on the suffix class used. For example, I'd like to define a class that - when used - always has the command run in a designated
default-directory
, or manages the compilation buffer associated with the command.In addition to some code deduplication, this would be useful for per-project suffixes. I have an existing implementation that implements management of variables like the ones mentioned, but it relies on a bespoke syntax that expands into something that
transient-parse-suffixes
can read, and necessarily restricts the user to what I've implemented in the syntax (not to mention the overhead of users having to learn an extra DSL). Preferably, this could be done with just Transient syntax.Problem with attempted solutions
Here's a (buggy) proof of concept for what I'm trying to accomplish, simplified from what I've implemented in my
suffix-classes
branch (here; specific commit that adds the classes here):This mostly works, but as noted in one of the comments, one of its problems is that the advice will affect unrelated calls as well if a command like
find-file
is inserted.I had some other iterations where I tried replacing the value of the
command
slot with another function, but for some reason unclear to me the new command would not be not used. If we replaceinitialize-instance
with the commented version and re-evaluate, for instance, none of the suffix commands are run in the expected directory when called from the prefix or with a direct call totest-message
. Completing atest:*
command viaeval-expression
, however, gives the expected correct result.Beta Was this translation helpful? Give feedback.
All reactions