This year I continue with a project I had begun at the last Hackweek event.

The Idea

Use transient to build a OpenQA Framework on emacs.

I have to admit that the was a rough idea of the final design. As a learning project I tend to open emacs and try out things to see what works and what not. Once it works i start giving it a shape and an form. This was my aproach the last year. The result back then was some functions (actually it was one main function) which was bind in transient keys. This year i start over with some more clear idea about how i want the transient menu to be. But still, i didnt sit beforehand for any proper design. And let this to take me wherever…

The Challenges

I use emacs as day to day editor but i have never dig deep into the programming on it. Usually i copy-paste configuration and functions i want to use from various guides and documentations. However i was always thinking i need to do and learn some Lisp programming. In particular, emacs-lisp. First because it is a very interesting language with many features which other modern languages have adapted. Second it is the default language emacs itself and know it give you incredible power.

However it is not the most easy language to learn.

Then it is transient. Transient implemented as part of magit and it is just beautiful and open to many usages. The magit team provides it as a standalone package and there is some documentation to get started. The main challenge is not to run the transient but how to put everything together and integrated to do some useful stuff to a new framework.

It is hard to consider all the challenges in advanced of something with so many new concepts for me. And obviously more came up.

Day1 and Day2 - transient

The first day I started from https://github.com/positron-solutions/transient-showcase. This was a good starting point because the documentation is not coming with good examples which demostrate the different features. That went well and my confidence bumped up. i tried one by one the examples. In some cases the examples use functions which are not defined. Fortunatelly, most of them can be found in the repo file. The next step was to adjust the transient UI in my basic idea for the OpenQA framework.

Day3

The funtion i had created last year was calling an OpenQA API, was getting some results which was coverting into a list and display in a dedicated defined new buffer. The problem was that i would like to simulate the buffer as in magit-status buffer. Here was difficult because the transient package is responsible only for the key binding UI. My initial assuption was that it might be part of it and i was wrong. So I decided to take a look and search for documentation of how to create buffers and stuff. That was not hard at first but yet, I couldnt get the results i want.Magit accomplishes the buffer layout somehow different. Again the Magit documentation is extensive but it is hard to understand how to get there, especially if you are new to lisp and emacs. I thought that my only solution would be to check the code in the magit repo. That was also hard for the reasons i just mentioned. Luckily i learnt a few things but i couldnt put everything together.

That took me some time until find and realise (with the help from the SystemCrafters) that the magit buffers uses their own packages which implements the functionality of the buffer. That is the /magit-sections/

Day4 and Day5

It turned out that /magit-sections/ could also be used as a standalone module. The author made this available recently but the documentation is not completed. The best resource maybe is the magit wiki to take a taste, following the official documentation.

/magit-sections/ are responsible only for creating a representative bits of your UI inside a buffer. At this point i have all the individual bits working, at least with some demo functions but i could put everything together and structure the application in a way that holds a proper design. In my head, i need a file which is implemented the OpenQA buffer, another which defines the API calls and then a main module which defines the mode and the transient. But i struggle to see how. Maybe a transient key should be bind to the mode which will create the buffer.

TL;DR

Obviously I have a lot to learn yet. And I would like to write some things down and publish them in some point to give others the resources to play with those tools from magit. As for the framework, i think there are many ideas once the main components start coming together. Hackweek is an amazing opportunity to do something different. The problem is that I would like to do more than one thing as there are many beautiful idea by me as well as from others which i would like to involve, And finally I saw many cool stuff from some colleagues, which i might take the chance to write about that another time.