Emacs and Xembed

GNU Emacs 23.1 supports the XEmbed specification. You can embed Emacs in another application on X11. The command line option --parent-id is used to pass the parent window id to Emacs. See http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html for details about XEmbed.

embedding emacs in other apps

currently I have no good example of how this works with existing apps, but I made a small gtk app that creates a gtk_socket, and prints the window id of that socket. When the program runs, emacs can be started with the --parent-id flag with the socket id, and emacs shows up in the demo app. Cool!

It would be very cool to embed Emacs into Iron or Firefox so every TEXTAREA would be governed by Emacs. Maybe EmbeddedEditor can be updated to do this. I tried it at some point but I could not get it to work properly.

I created a small proof-of-concept PyQt4 program which just opens a window and embeds emacs in it.

You can now embed emacs in KMail: https://bugs.kde.org/show_bug.cgi?id=255008 emacs --parent-id %w %f I still have some issues with it, though: the emacs frame starts tiny instead of filling the textarea (I filed an emacs bug for that: http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-01/msg00623.html ).

I’ve created an extensions that use XEMBED to embed emacs (and other editors) into firefox or chromium which you can find here: https://github.com/larsjsol/edembed . I hope it will be useful for some of you.

embedding apps in emacs windows

To embed applications in Emacs, see EmacsXWidgets