The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ
GObject boilerplate generator for Emacs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Gergely Polonkai ed2c2b0d21 Update docstrings 6 years ago
.gitignore Add .gitignore file 8 years ago Move TODO to 6 years ago
gobgen.el Update docstrings 6 years ago


Generate boilerplate code for a GObject descendant in Emacs.


  1. Execute M-x gobgen
  2. Specify a class name in snake_case
  3. Specify a parent class name in snake_case
  4. If the guessed prefixes are not OK, fix them
  5. Check GLib >= 2.38 if you are building for new(ish) GLib versions. This puts some optimalizations in the code, like makes use of macros like g_object_get_private
  6. Check Has private members if you want to add a private struct to your object


  1. Clone this repository and add it to your load-path
  2. (require 'gobgen)


If you have a feature idea or find a bug, feel free to issue a pull request. If you need any help with the code, find me on Matrix as


This package is heavily based on Gustavo Sverzut Barieri’s gobject-class.el.

Future plans

There are tons of features I plan, here is a brief list:

  • Properties
  • Signals
  • Pre-define methods, virtual or not
  • Add GTK-Doc blocks for for the generated code
  • Widget specialization ** Standalone with custom render() method ** Composite ** Templated composite, that should also create a GtkBuilder template
  • Add some help text for fields
  • GLib requirement check (if 2.38 is turned on)
  • Possibly add a GET_PRIV macro for 2.38+


gobgen.el depends only on the Emacs widget library.

Tested on Emacs 24.3 and 25.1, please report if you succeed (or fail) on other versions!