# The Emacs widget toolkit | Aleksandr Petrosyan

**URL:** <https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572>\
**Category:** Emacs Lisp\
**Created:** [April 27, 2025, 3:52am UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572 "2025-04-27T03:52:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![tusharhero](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tusharhero](https://forum.systemcrafters.net/u/tusharhero)\
**Post date:** [April 27, 2025, 3:52am UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/1 "2025-04-27T03:52:00Z")

</div>

> **[The Emacs widget toolkit | Aleksandr Petrosyan](https://appetrosyan.github.io/posts/emacs-widget.html)**

(Accidentally deleted the previous post)

---

<div class="post-metadata">

**Author:** ![ANoobyBird](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@ANoobyBird](https://forum.systemcrafters.net/u/ANoobyBird)\
**Post date:** [April 27, 2025, 9:19am UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/2 "2025-04-27T09:19:41Z")

</div>

This is very interesting. The only tenet would be “document as graphics”, or more accurately “elisp code as graphics”, and the only requirement would be a (very very very) careful choice of the “atoms” of gui to be exposed to elisp (any additional requirement may impose unnecessary limitations). And instead of restricting to one format (which in this context could mean a document-to-graphics mapping), there could be any number of such formats, maybe with one or a few of them built-in, and the users can specify their own format as they see fit, as long as Emacs understands it in terms of the combinations of the “atoms” in the end. I hope that the proposal in this link will be heard by more of both users and developers, and will begin to take shape soon, and if it does, it could aim to be something far more versatile than frameworks like electron, not merely a substitute or a competitor.

---

<div class="post-metadata">

**Author:** ![appetrosyan](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@appetrosyan](https://forum.systemcrafters.net/u/appetrosyan)\
**Post date:** [April 28, 2025, 2:21pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/3 "2025-04-28T14:21:20Z")

</div>

Author here.

I did not expect this post to blow up, this is a bit early, as the blog is still quite rough around the edges. More updates to come

I want to do a more detailed discussion of how the TUI and Text work, before diving head-first into the weeds of display code.

> he only tenet would be “document as graphics”, or more accurately “elisp code as graphics”, and the only requirement would be a (very very very) careful choice of the “atoms” of gui to be exposed to elisp (any additional requirement may impose unnecessary limitations).

That is indeed the case.

> I hope that the proposal in this link will be heard by more of both users and developers, and will begin to take shape soon, and if it does, it could aim to be something far more versatile than frameworks like electron, not merely a substitute or a competitor.

That is the hope.

---

<div class="post-metadata">

**Author:** ![dgr](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/dgr/32/394_2.png) [@dgr](https://forum.systemcrafters.net/u/dgr)\
**Post date:** [April 28, 2025, 3:28pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/4 "2025-04-28T15:28:50Z")

</div>

Still reading but I can say that I agree and as far as I got agree with the paradigm.

Update when I digested the whole piece.

---

<div class="post-metadata">

**Author:** ![appetrosyan](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@appetrosyan](https://forum.systemcrafters.net/u/appetrosyan)\
**Post date:** [May 5, 2025, 2:57pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/5 "2025-05-05T14:57:49Z")

</div>

I plan to create a more technical discussion of Emacs’ rendering internals. This discussion is a bit vapid without concrete explanations. And I got into a lot of hot water… let’s just say… on places like Reddit, because I haven’t explained the idea clearly.

---

<div class="post-metadata">

**Author:** ![dgr](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/dgr/32/394_2.png) [@dgr](https://forum.systemcrafters.net/u/dgr)\
**Post date:** [May 6, 2025, 9:15am UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/6 "2025-05-06T09:15:29Z")

</div>

I finally had the time to finish the read and I still agree.  
One thing lingering in my mind is the single threaded nature of Emacs.  
Drawing shouldn’t delay or even block user input and the current nature of multi core CPU and GPU systems it would be a waste to not be able to spread the load.

---

<div class="post-metadata">

**Author:** ![ANoobyBird](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@ANoobyBird](https://forum.systemcrafters.net/u/ANoobyBird)\
**Post date:** [May 7, 2025, 7:45pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/7 "2025-05-07T19:45:35Z")

</div>

How exciting, looking forward to it!\[1\]

* * *

1. I am an amateur and probably won’t be able to fully digest the discussion, let alone providing useful feedback, but will definitely be there!

---

<div class="post-metadata">

**Author:** ![appetrosyan](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@appetrosyan](https://forum.systemcrafters.net/u/appetrosyan)\
**Post date:** [May 7, 2025, 8:18pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/8 "2025-05-07T20:18:52Z")

</div>

So roughly the plan around that is not to fix concurrency in Elisp. It’s just not a practically solvable problem.

Instead we rely on the fact that you don’t necessarily need to have the same lisp machine in all the components. Just some lisp machine that is aware of the global state.

So you can break up the execution into islands that can freely communicate via some form of IPC, probably something specific to Emacs with a symbolic expression bent. You now don’t block when your LSP hangs, because the process that controls the main window isn’t the one that blocks on the LSP.

This means that some core components would need to be rewritten to facilitate message-passing, and this is not something that I would do with the initial implementation. But it would allow you to have a concurrent, not necessarily parallel implementation of Emacs.

---

<div class="post-metadata">

**Author:** ![tusharhero](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tusharhero](https://forum.systemcrafters.net/u/tusharhero)\
**Post date:** [May 9, 2025, 2:01am UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/9 "2025-05-09T02:01:37Z")

</div>

@appetrosyan , you should check this out: [https://codeberg.org/ramin\_hal9001/gypsum/issues/16](https://codeberg.org/ramin_hal9001/gypsum/issues/16)

---

<div class="post-metadata">

**Author:** ![montaropdf](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@montaropdf](https://forum.systemcrafters.net/u/montaropdf)\
**Post date:** [June 11, 2025, 8:24pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/10 "2025-06-11T20:24:48Z")

</div>

Hello,

When I click on the link in the original post I got a 404 HTTP code. Browsing your blog posts, I don’t see this post.

Any other place where I can read your post. I think I read it already, sometimes ago, but I am not sure anymore. As the topics interest me I would like to be sure of the content of the blog post before emitting any idea.

---

<div class="post-metadata">

**Author:** ![tusharhero](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tusharhero](https://forum.systemcrafters.net/u/tusharhero)\
**Post date:** [June 12, 2025, 8:55am UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/11 "2025-06-12T08:55:39Z")

</div>

> **[The Emacs widget toolkit](https://appetrosyan.github.io/posts/emacs-widget/)**
>
> In this blog post I outline the consequences of several months worth of deliberation and dumpster diving into the Emacs display code.
> In this article I shall outline the potential direction in which to take the Emacs widget toolkit, a plan to...

---

<div class="post-metadata">

**Author:** ![montaropdf](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@montaropdf](https://forum.systemcrafters.net/u/montaropdf)\
**Post date:** [June 15, 2025, 4:53pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/12 "2025-06-15T16:53:54Z")

</div>

Thanks.

This is not the article I thought I read, but thanks for the link anyway, quite a lot of information to process.

And if I may, @appetrosyan here is the article I was referring to [Emacs GUI library · Andrey Listopadov](https://andreyor.st/posts/2023-07-11-emacs-gui-library/).

---

<div class="post-metadata">

**Author:** ![appetrosyan](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@appetrosyan](https://forum.systemcrafters.net/u/appetrosyan)\
**Post date:** [June 17, 2025, 3:57pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/13 "2025-06-17T15:57:34Z")

</div>

@montaropdf

I wish I read this article before writing mine.

The number of people writing about this seems to indicate a great appetite for the feature.

---

<div class="post-metadata">

**Author:** ![appetrosyan](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@appetrosyan](https://forum.systemcrafters.net/u/appetrosyan)\
**Post date:** [June 17, 2025, 3:58pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/14 "2025-06-17T15:58:38Z")

</div>

@montaropdf

Also, regarding the 404. I migrated to `hugo` since that article was originally published, so the URL is slightly different now.

> **[The Emacs widget toolkit](https://appetrosyan.github.io/posts/emacs-widget/)**
>
> In this blog post I outline the consequences of several months worth of deliberation and dumpster diving into the Emacs display code.
> In this article I shall outline the potential direction in which to take the Emacs widget toolkit, a plan to...

---

<div class="post-metadata">

**Author:** ![montaropdf](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@montaropdf](https://forum.systemcrafters.net/u/montaropdf)\
**Post date:** [June 18, 2025, 5:45am UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/15 "2025-06-18T05:45:50Z")

</div>

Maybe it is time to get in touch with Mr. Listopadov, and get him onboard. So he can share its thought and hopefully makes this discussion goes forward to an actual project.

And to add to the ambient noise, here are a few thoughts and ideas I have written over the years, on what I would like to see in emacs, especially for a version that include a widget toolkit.

> **[~montaropdf/evomacs -

Some thoughts and ideas for emacs -

sourcehut git](https://git.sr.ht/~montaropdf/evomacs)**

They are really a big pile of ideas and thoughts, which lacks structures, I am still kind of updating them overtime. So, please, be indulgent 🙏.

---

<div class="post-metadata">

**Author:** ![appetrosyan](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@appetrosyan](https://forum.systemcrafters.net/u/appetrosyan)\
**Post date:** [July 6, 2025, 3:38pm UTC](https://forum.systemcrafters.net/t/the-emacs-widget-toolkit-aleksandr-petrosyan/1572/16 "2025-07-06T15:38:48Z")

</div>

I’d be happy to. I’m in no position to start working at this yet, but in the long term this needs to have input from the community.
