diff -Naur /tmp/garlic/form.autosave.js garlic/form.autosave.js
--- a/garlic/form.autosave.js	1969-12-31 21:00:00.000000000 -0300
+++ b/garlic/form.autosave.js	2015-10-20 16:57:22.573396852 -0200
@@ -0,0 +1,82 @@
+(function ($) {
+  Drupal.behaviors.formAutoSave = {
+    attach: function (context, settings) {
+      for (var formID in settings.formAutoSave) {
+        if (settings.formAutoSave.hasOwnProperty(formID)) {
+          var changed = settings.formAutoSave[formID];
+          $(context)
+            .find('#' + formID)
+            // Give the form a data- attribute to indicate its last modification.
+            .attr('data-formautosave-changed', changed)
+            // Attach garlic.
+            .garlic({
+              inputs: 'input[type!=file][type!=hidden][type!=submit][type!=button], textarea, select',
+              events: [ 'editorSerializedAfterChange', 'textInput', 'input', 'change', 'keypress', 'paste', 'focus' ],
+              expires: 86400 * 30,
+              conflictManager: {
+                enabled: false
+              },
+              getPath: generateGarlicLocalStorageKey
+            });
+        }
+      }
+    }
+  };
+
+  /**
+   * Override for garlic.js' localStorage key generation.
+   *
+   * garlic.js' getPath() implementation contains a lot of complexity, because
+   * they can't make any assumptions about the HTML of the form; because all forms
+   * in Drupal are generated by Form API, we can simplify a lot.
+   * We don't need to store the entire DOM node path, because each form item (as
+   * well as the form itself) is uniquely identified by its id attribute.
+   * We also don't need to look at the current URL thanks to
+   * drupalSettings.currentPath; without that, we could run into edge cases of
+   * e.g. www vs. no-www URLs of the same site.
+   * Finally, it takes a "last modification" identifier into account, which allows
+   * us to ignore localStorage data that doesn't apply anymore to the latest
+   * version of the object that the form allows the user to edit.
+   *
+   * @param jQuery $element
+   *   A jQuery element of a form item.
+   */
+  function generateGarlicLocalStorageKey ($element) {
+    var key = '';
+    var $form = $element.closest('form');
+
+    // garlic.js prefix. Allows garlic.js to do clean-up.
+    key += 'garlic:';
+
+    // Drupal path at which this form lives.
+    key += window.location.pathname.substr(1); // trim the leading slash
+
+    // "last modification" identifier.
+    key += '~';
+    key += $form.attr('data-formautosave-changed');
+
+    // Unique form identifier; CSS selector-like syntax.
+    key += '>';
+    key += 'form#' + $form.attr('id');
+    key += ' ';
+
+    // Unique form item identifier; CSS selector-like syntax.
+    key += $element.prop('tagName').toLowerCase();
+    key += '#' + $element.attr('id');
+
+    return key;
+  }
+
+  Drupal.behaviors.ckeditorGarlic = {
+  attach: function (context, settings) {
+    if (typeof(CKEDITOR) != 'undefined') {
+      CKEDITOR.on('instanceCreated', function(e) {
+        e.editor.on('change', function (event) {
+          e.editor.updateElement();
+          $(e.editor.element.$).trigger('change');
+        });
+      });
+    }
+  }
+};
+})(jQuery);
diff -Naur /tmp/garlic/garlic.module garlic/garlic.module
--- a/garlic/garlic.module	2013-03-15 17:24:57.000000000 -0300
+++ b/garlic/garlic.module	2015-10-20 16:42:18.537423563 -0200
@@ -5,7 +5,7 @@
  * Adds the garlic.js library to Drupal and enable basic toggling on entities
  */
 
-define(GARLIC_DEBUG, variable_get('garlic_debug', FALSE));
+define('GARLIC_DEBUG', variable_get('garlic_debug', FALSE));
 
 /**
  * Implements hook_libraries_info().
@@ -69,5 +69,18 @@
 function garlic_form_alter(&$form, &$form_state, $form_id) {
   if (isset($form['#attributes']['data-persist']) && 'garlic' == $form['#attributes']['data-persist']) {
     $form['#attached']['library'][] = array('garlic', 'garlic');
+    $form['#attached']['js'][] = drupal_get_path('module', 'garlic') . '/form.autosave.js';
+
+    $autosave_key = !empty($form_state['node']->changed) ? (int) $form_state['node']->changed : 1;
+
+    $form['#attached']['js'][] = array(
+      'data' => array(
+        'formAutoSave' => array(
+          $form['#id'] => $autosave_key,
+        ),
+      ),
+      'type' => 'setting',
+    );
+
   }
-}
\ No newline at end of file
+}
