Embark is a keyboard-based UI combinator of relevant command options, a Swiss army knife for working within Emacs. It integrates beautifully with other libraries, like Marginalia and Consult, to compound unobtrusive, powerful means to connect several Emacs parts, simplifying the editing flow and enriching user interactions. The library’s author, Omar Antolín, describes Embarks as a tool to provide a keyboard-based equivalent for the right-click contextual menus in GUI apps. That alone, to readily count with such handy assortments of sensitive commands, is an incredible leverage for doing things more efficiently within the editor.
Embark-act allows selecting actions to be called for the object at or near point. It also permits doing additional tasks in flexible ways. So, besides the main action, one could conveniently carry on another task in between. Whether a candidate in a minibuffer selection, a region highlighted, a paragraph where our cursor is, a sexp, or the entire buffer you have open, Embark will handily show you a set of connected possible actions relevant to each target.
This excellent article from Karthinks points out that Embark operates on the premise of a shifted order of doing things. Instead of a “verb -> object” logic, it follows a swapped pattern of “object -> verb” (the grammar for target -> action, in Elisp terms). That is, rather than saying “open <file>”, when presented with a given candidate, it you choose what to do with that file (maybe open, delete it, insert-its-content-into-the-buffer, etc). A bunch of suitable actions appear to be discovered with this reversed grammar model, bringing power —like Yoda speaking in his oddly but wise backward-speech pattern.
Embark significantly boosts the power of users choosing actions. Therefore, any command is accessible to deal with whatever object we pick as a candidate. If it’s a file, file-related options are presented (such as copy, open, remove, etc.) If it’s a word, other pertinent commands will pop up as possible actions to call (move, uppercase, transpose, search-synonyms, etc.) The same regarding buffers, regions, sexp, and more. It returns relevant actions readily available, just a single shortcut letter away.
Whatever the thing, Embark presents sensitive options in place for the candidate (picking the nature of the target at point via metadata info that says what category of object it belongs to). By pulling from (easily configurable and expandable) maplists, these contextually relevant options provide quicker access to different actions for each candidate.
With Embark you are always closer, just a few keys away, from doing whatever you could do onto the targets. It even gives key bindings to unbound commands. All those single-key shortcuts act like abracadabras to magically ease things up within your flow.
There are about 320 available Embark functions classified for each object. (See them at https:/github.com/oantolin/embark/wiki/Default-Actions)
Its impact results in a Blizz of enhanced productivity.
The omniscient-like ubiquity of Embark makes doing things a snap. There are lots of other benefits and features worth checking, which you could read about at the library’s intro (https://github.com/oantolin/embark#quick-start)
Discover how deeply this UI innovating paradigm can benefit your editor´s usage. The genie of Embark and brothers went out of the bottle. Big thanks to Omar Antolin and Daniel Mendler, authors of Embark, Consult, and Marginalia, for these gems of tools that put (yet) more power into the hands of Emacs users!
