Espresso

Recent Changes

Although we try to keep the plug-in system backwards compatible, sometimes we make changes that will require updating your plug-in.

Since Espresso 25.12

Naming

Plug-ins have the file extension .sugar again, and the plug-ins bundled with Espresso are named that way. A plug-in named .espressoplugin is still loaded, and you do not need to rename one that people have already installed. Opening a plug-in of either name installs it.

Compiled code

Espresso no longer loads compiled code from a plug-in. A plug-in is XML, CSS and JavaScript, which is all that most plug-ins ever were. If your plug-in has an executable:

The Cocoa API, its headers and the Xcode template are gone with it.

Bundled actions

The actions of the Convert / Strip, Select, Text and HTML menus are part of Espresso itself and no longer come from the bundled TEA for Espresso plug-in, which is gone along with its JavaScript files and libraries. The actions of the Markdown menu are part of Espresso too, and the Markdown plug-in no longer has scripts. The actions keep their identifiers, so keyboard shortcuts and anything else that refers to one by identifier are unaffected.

Key equivalents

In a <key-equivalent>, enter is the Return key, as it was always meant to be. It had stopped matching any key, so actions and snippets that use it respond to their shortcuts again. return is the Return key too. It used to mean the Enter key of a numeric keypad, which is now keypad-enter.

Espresso 3.0

Plug-ins should remain backwards compatible between Espresso 2.0 and 3.0. However, there are a number of changes and additions you may wish to take into consideration:

Naming

Rather than continuing to refer to plug-ins as "Sugars", we are now switching to the more generic and easily understood "plug-in". The .sugar file extension is deprecated in favor of .espressoplugin, and may be removed in the future. Plug-ins will now be automatically installed in this folder:

~/Library/Application Support/Espresso/Plug-Ins/

XML files

Itemizer XML has been completely overhauled (old syntax will continue to work, but is deprecated and may be removed in a future update):

x-espresso URL scheme

A new URL scheme has been added to allow you to open arbitrary files within Espresso, and optionally select particular lines or ranges.

Espresso 2.0

For the most part, plug-ins should be backwards compatible between Espresso 1.0 and 2.0. However, the following changes may affect your plug-in (some of these were available in 1.0 but are being officially exposed for the first time in 2.0):

Actions

Espresso 2.0 offers all-new JavaScriptActions for easily writing TextActions without needing compiled code. The bundled TEA for Espresso.sugar has been converted to run mainly using the new JavaScript API, so take a look at its source for some excellent examples, or take a gander at the API documentation.

TEA Python actions have been removed. Any Python actions using the TEAforEspresso class will need to be ported to JavaScript or Objective-C. For the time being, the TEALoader class remains, so you can continue to leverage actions in arbitrary shell languages using STDIN and STDOUT.

The third party Spice.sugar is no longer supported. You will need to port any actions using the Spice class over to the built-in JavaScript API.

API changes

It is no longer possible to define custom Itemizer classes for third party plug-ins. If you have a need that is not being covered by existing Itemizer classes in Espresso, please let us know.

CETextConvertingOptions has been deprecated in favor of CETextOptions; see EspressoTextCore.h for details.

CETextRecipe's addReplacementString:forRange:, addInsertedString:forIndex:, and addDeletedRange: methods have all been deprecated in favor of the simpler replaceRange:withString:, insertString:atIndex:, and deleteRange: methods.

CELineStorage's pass-by-reference lineNumber attribute in the lineStartIndexForIndex:lineNumber: method has been deprecated.

First-party plug-ins

First-party plug-ins use completely different root syntax zone names (text.basic.html ⟩ language-root.html, for instance). If you are extending a first-party plug-in, you will need to update your plug-in or theme to use the new naming schemes and syntax zones.

Changes to specific plug-ins:

Themes

Themes now use a special :document-base selector instead of @base for styling the root document; see SyntaxThemes. The @base selector is deprecated, and may be phased out in future updates.

XML files