{"id":11574,"date":"2023-08-20T12:07:35","date_gmt":"2023-08-20T16:07:35","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=11574"},"modified":"2023-08-20T12:07:35","modified_gmt":"2023-08-20T16:07:35","slug":"transient-as-a-hydra","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=11574","title":{"rendered":"Transient As A Hydra"},"content":{"rendered":"<p>Most every Magit user is, I&rsquo;m sure, aware that the Magit menuing system has been refactored into a separate library, <a href=\"https:\/\/github.com\/magit\/transient\">transient<\/a>, that is available for anyone to use. I&rsquo;m dimly aware that some Elisp projects\u2014although I couldn&rsquo;t name one off the top of my head\u2014are already taking advantage of it. I just stumbled across a case of transient being leveraged in an individual user&rsquo;s configuration.<\/p>\n<p>Tory Anderson is using <a href=\"https:\/\/tech.toryanderson.com\/2023\/08\/19\/how-can-i-define-transient-color-per-command-like-hydra\/\">transient as a replacement for hydras<\/a>. Emacs <a href=\"https:\/\/github.com\/abo-abo\/hydra\">hydras<\/a> are a package by abo-abo that provides a straightforward way to configure menuing systems in Elisp. They&rsquo;re easy to set up with a simple description in your Elisp. You can take a look at Anderson&rsquo;s post to see the code for one of his hydra replacements. I have a hydra that does essentially the same thing and the code looks almost identical.<\/p>\n<p>To me, the interesting thing about Anderson&rsquo;s post is not a particular hydra replacement nor the particular problem he&rsquo;s solving but the idea of using transient instead of a hydra. I don&rsquo;t see any advantage to using transient instead of a hydra and even Anderson says his efforts to replace hydras with transient are mainly a proof of concept. Still, it&rsquo;s an interesting idea and shows how easy it is to take advantage of the transient library. Anderson has <a href=\"https:\/\/tech.toryanderson.com\/2021\/09\/23\/fail-fast-transients-like-hydra\/\">another post<\/a> on transient and hydras if you&rsquo;re interested in the idea. That post notes that the transient documentation is available in the Emacs help system as long as Magit is installed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most every Magit user is, I&rsquo;m sure, aware that the Magit menuing system has been refactored into a separate library, transient, that is available for anyone to use. I&rsquo;m dimly aware that some Elisp projects\u2014although I couldn&rsquo;t name one off &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=11574\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-11574","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11574"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11574\/revisions"}],"predecessor-version":[{"id":11575,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11574\/revisions\/11575"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}