File: embark.el.html

This package provides a sort of right-click contextual menu for Emacs, accessed through the embark-act command (which you should bind to a convenient key), offering you relevant actions to use on a target determined by the context:

- In the minibuffer, the target is the current best completion
 candidate.
- In the *Completions* buffer the target is the completion at point.
- In a regular buffer, the target is the region if active, or else the
 file, symbol or url at point.

The type of actions offered depend on the type of the target:

- For files you get offered actions like deleting, copying,
 renaming, visiting in another window, running a shell command on the
 file, etc.
- For buffers the actions include switching to or killing the buffer.
- For package names the actions include installing, removing or
 visiting the homepage.

Everything is easily configurable: determining the current target, classifying it, and deciding with actions are offered for each type in the classification. The above introduction just mentions part of the default configuration.

Configuring which actions are offered for a type is particularly easy and requires no programming: the embark-keymap-alist variable associates target types with variable containing keymaps, and those keymaps containing binds for the actions. For example, in the default configuration the type file is associated with the symbol embark-file-map. That symbol names a keymap with single-letter key bindings for common Emacs file commands, for instance c is bound to copy-file. This means that if while you are in the minibuffer after running a command that prompts for a file, such as find-file or rename-file, you can copy a file by running embark-act and then pressing c.

These action keymaps are very convenient but not strictly necessary when using embark-act: you can use any command that reads from the minibuffer as an action and the target of the action will be inserted at the first minibuffer prompt. After running embark-act all of your key bindings and even execute-extended-command can be used to run a command. The action keymaps are normal Emacs keymaps and you should feel free to bind in them whatever commands you find useful as actions.

The actions in embark-general-map are available no matter what type of completion you are in the middle of. By default this includes bindings to save the current candidate in the kill ring and to insert the current candidate in the previously selected buffer (the buffer that was current when you executed a command that opened up the minibuffer).

You can read about the Embark GitHub project wiki: https://github.com/oantolin/embark/wiki/Default-Actions

Besides acting individually on targets, Embark lets you work collectively on a set of target candidates. For example, while you are in the minibuffer the candidates are simply the possible completions of your input. Embark provides three commands to work on candidate sets:

- The embark-act-all command runs the same action on each of the
  current candidates. It is just like using embark-act on each
  candidate in turn.

- The embark-collect command produces a buffer listing all
  candidates, for you to peruse and run actions on at your leisure.
  The candidates are displayed as a list showing additional
  annotations.

- The embark-export command tries to open a buffer in an
  appropriate major mode for the set of candidates. If the
  candidates are files export produces a Dired buffer; if they are
  buffers, you get an Ibuffer buffer; and if they are packages you
  get a buffer in package menu mode.

These are always available as "actions" (although they do not act on just the current target but on all candidates) for embark-act and are bound to A, S (for "snapshot") and E, respectively, in embark-general-map. This means that you do not have to bind your own key bindings for these (although you can, of course), just a key binding for embark-act.

Defined variables (87)

embark--advice-regexpRegexp to match lines about advice in function documentation strings.
embark--associated-file-fn-alistAlist of functions that extract a file path from targets of a given type.
embark--auto-prefix-help-timerTimer used to decide when to display automatic prefix help.
embark--backup-prefix-help-commandPrevious value ‘prefix-help-command’ to restore.
embark--commandCommand that started the completion session.
embark--hlineHorizontal line used to separate multiline collect entries.
embark--prompter-historyHistory used by the ‘embark-completing-read-prompter’.
embark--rerun-functionFunction to rerun the collect or export that made the current buffer.
embark--run-after-command-functionsAbnormal hook, used by ‘embark--run-after-command’.
embark--selectionBuffer local list of selected targets.
embark--target-bufferCache for the previous buffer, meant to be set buffer-locally.
embark--target-windowCache for the previous window, meant to be set buffer-locally.
embark--toggle-quitShould we toggle the default quitting behavior for the next action?
embark--typeCache for the completion type, meant to be set buffer-locally.
embark-after-export-hookHook run after ‘embark-export’ in the newly created buffer.
embark-around-action-hooksAlist associating commands with post-action hooks.
embark-auto-prefix-help-delayDelay in seconds before automatic prefix help is shown.
embark-auto-prefix-help-modeNon-nil if Embark-Auto-Prefix-Help mode is enabled.
embark-auto-prefix-help-mode-hookHook run after entering or leaving ‘embark-auto-prefix-help-mode’.
embark-become-file+buffer-mapEmbark become keymap for files and buffers.
embark-become-help-mapKeymap for Embark help actions.
embark-become-keymapsList of keymaps for ‘embark-become’.
embark-become-match-mapEmbark become keymap for search.
embark-become-shell-command-mapEmbark become keymap for shell commands.
embark-bookmark-mapKeymap for Embark bookmark actions.
embark-buffer-mapKeymap for Embark buffer actions.
embark-candidate-collectorsList of functions that collect all candidates in a given context.
embark-collect--outline-stringSpecial string used for outline headings in Embark Collect buffers.
embark-collect-direct-action-minor-modeNon-nil if Embark-Collect-Direct-Action minor mode is enabled.
embark-collect-direct-action-minor-mode-hookHook run after entering or leaving ‘embark-collect-direct-action-minor-mode’.
embark-collect-group-formatFormat string used for the group title in Embark Collect buffers.
embark-collect-mode-hookHook run after entering ‘embark-collect-mode’.
embark-collect-mode-mapKeymap for Embark collect mode.
embark-command-mapKeymap for Embark command actions.
embark-confirm-act-allShould ‘embark-act-all’ prompt the user for confirmation?
embark-cycle-keyKey used for ‘embark-cycle’.
embark-default-action-overridesAlist associating target types with overriding default actions.
embark-defun-mapKeymap for Embark defun actions.
embark-email-mapKeymap for Embark email actions.
embark-encode-mapKeymap for Embark region encoding actions.
embark-exporters-alistAlist associating completion types to export functions.
embark-expression-mapKeymap for Embark expression actions.
embark-face-mapKeymap for Embark face actions.
embark-file-mapKeymap for Embark file actions.
embark-flymake-mapKeymap for Embark actions on Flymake diagnostics.
embark-function-mapKeymap for Embark function actions.
embark-general-mapKeymap for Embark general actions.
embark-heading-mapKeymap for Embark heading actions.
embark-help-keyKey used for help.
embark-identifier-mapKeymap for Embark identifier actions.
embark-indicatorsIndicator functions to use when acting or becoming.
embark-keybinding-repeatIndicator string for repeatable keybindings.
embark-keymap-alistAlist of action types and corresponding keymaps.
embark-keymap-prompter-keyKey to switch to the keymap prompter from ‘embark-completing-read-prompter’.
embark-kill-ring-mapKeymap for ‘kill-ring’ commands.
embark-library-mapKeymap for operations on Emacs Lisp libraries.
embark-meta-mapKeymap for non-action Embark functions.
embark-mixed-indicator-bothShow both indicators, even after the verbose indicator appeared.
embark-mixed-indicator-delayTime in seconds after which the verbose indicator is shown.
embark-multitarget-actionsCommands for which ‘embark-act-all’ should pass a list of targets.
embark-package-mapKeymap for Embark package actions.
embark-paragraph-mapKeymap for Embark actions for dealing with paragraphs.
embark-post-action-hooksAlist associating commands with post-action hooks.
embark-pre-action-hooksAlist associating commands with pre-action hooks.
embark-prompterFunction used to prompt the user for actions.
embark-prose-mapKeymap for Embark actions for dealing with prose.
embark-quit-after-actionShould ‘embark-act’ quit the minibuffer?
embark-record-minibuffer-historyControl when acted-on minibuffer candidates go into history.
embark-region-mapKeymap for Embark actions on the active region.
embark-repeat-actionsList of repeatable actions.
embark-selection-indicatorMode line indicator used for selected candidates.
embark-sentence-mapKeymap for Embark actions for dealing with sentences.
embark-separator-historyInput history for the separators used by some embark commands.
embark-sort-mapKeymap for Embark actions that sort the region
embark-symbol-mapKeymap for Embark symbol actions.
embark-tab-mapKeymap for actions for tab-bar tabs.
embark-target-findersList of functions to determine the target in current context.
embark-target-injection-hooksAlist associating commands with post-injection setup hooks.
embark-transformer-alistAlist associating type to functions for transforming targets.
embark-unicode-name-mapKeymap for Embark Unicode name actions.
embark-url-mapKeymap for Embark url actions.
embark-variable-mapKeymap for Embark variable actions.
embark-vc-file-mapKeymap for Embark VC file actions.
embark-verbose-indicator-buffer-sectionsList of sections to display in the verbose indicator buffer, in order.
embark-verbose-indicator-display-actionParameters added to ‘display-buffer-alist’ to show the actions buffer.
embark-verbose-indicator-excluded-actionsCommands not displayed by ‘embark-verbose-indicator’.
embark-verbose-indicator-nestedWhether the verbose indicator should use nested keymap navigation.

Defined functions (208)

embark--act(ACTION TARGET &optional QUIT)
embark--action-command(ACTION)
embark--action-keymap(TYPE CYCLE)
embark--action-repeatable-p(ACTION)
embark--all-bindings(KEYMAP &optional NESTED)
embark--allow-edit(&rest _)
embark--as-file
embark--associated-directory(TARGET TYPE)
embark--associated-file(TARGET TYPE)
embark--auto-prefix-help()
embark--become-command(COMMAND INPUT)
embark--become-keymap()
embark--beginning-of-target
embark--boundaries()
embark--cache-info(BUFFER)
embark--cache-info--completion-list()
embark--cd
embark--collect(BUFFER-NAME)
embark--command-name(CMD)
embark--confirm
embark--cycle-key()
embark--default-action(TYPE)
embark--default-directory()
embark--define-hash(ALGORITHM)
embark--descriptive-buffer-name(TYPE)
embark--display-string(STR)
embark--end-of-target
embark--eval-prep
embark--export-customize(ITEMS TYPE PRED)
embark--export-rename(BUFFER TITLE &rest BODY)
embark--force-complete(&rest _)
embark--format-targets(TARGET SHADOWED-TARGETS REP)
embark--formatted-bindings(KEYMAP &optional NESTED)
embark--function-doc(SYM)
embark--get-affixator(TYPE)
embark--goto(TARGET)
embark--identifier-types(IDENTIFIER)
embark--ignore-target(&rest _)
embark--insert-in-minibuffer-selected-window-if-quitting
embark--ivy-candidates()
embark--ivy-selected()
embark--keybinding-command(TYPE TARGET)
embark--lookup-lighter-minor-mode(TYPE TARGET)
embark--mark-target
embark--maybe-transform-candidates()
embark--metadata()
embark--minibuffer-point()
embark--narrow-to-target
embark--orig-target(TARGET)
embark--package-desc(PKG)
embark--package-url(PKG)
embark--project-file-full-path(TYPE TARGET)
embark--prompt(INDICATORS KEYMAP TARGETS)
embark--prompt-for-package()
embark--quit-and-run(FN &rest ARGS)
embark--quit-p(ACTION)
embark--raw-action-keymap(TYPE)
embark--read-from-history(PROMPT CANDIDATES &optional CATEGORY)
embark--read-key-sequence(UPDATE)
embark--record-history-p(ACTION)
embark--record-target-in-history(ACTION TARGET)
embark--record-this-command()
embark--refine-multi-category(TYPE TARGET)
embark--remove-package-version(TYPE TARGET)
embark--rerun-function(KIND)
embark--restart(&rest _)
embark--rotate(LIST K)
embark--run-action-hooks(HOOKS ACTION TARGET QUIT)
embark--run-after-command(FN &rest ARGS)
embark--run-around-action-hooks(ACTION TARGET QUIT &optional NON-INTERACTIVE)
embark--save-excursion
embark--select
embark--selection-indicator()
embark--separator(STRINGS)
embark--shell-prep
embark--target-buffer()
embark--target-window(&optional DISPLAY)
embark--targets()
embark--truncate-target(TARGET)
embark--uniquify-orig-buffer(TYPE TARGET)
embark--universal-argument(&rest _)
embark--unmark-target(&rest ##)
embark--verbose-indicator-excluded-p(CMD)
embark--verbose-indicator-section-bindings
embark--verbose-indicator-section-cycle
embark--verbose-indicator-section-shadowed-targets
embark--verbose-indicator-section-target
embark--verbose-indicator-update(KEYMAP TARGETS)
embark--vertico-candidates()
embark--vertico-indicator()
embark--vertico-selected()
embark--with-category(CATEGORY CANDIDATES)
embark--with-completion-list-buffer(FUN)
embark--xref-push-marker(&rest _)
embark-act(&optional ARG)
embark-act-all(&optional ARG)
embark-auto-prefix-help-mode(&optional ARG)
embark-become(&optional FULL)
embark-bindings(GLOBAL)
embark-bindings-at-point()
embark-bindings-in-keymap(KEYMAP)
embark-browse-package-url(PKG)
embark-bury-buffer(BUF)
embark-collect()
embark-collect--direct-action-map(TYPE)
embark-collect--format-entries(CANDIDATES GROUPER)
embark-collect--metadatum(TYPE METADATUM)
embark-collect--target()
embark-collect--update-candidates(BUFFER)
embark-collect-choose(ENTRY)
embark-collect-direct-action-minor-mode(&optional ARG)
embark-collect-mode()
embark-completing-read-prompter(KEYMAP UPDATE &optional NO-DEFAULT)
embark-completion-list-candidates()
embark-compose-mail(ADDRESS)
embark-context-menu(MENU EVENT)
embark-copy-as-kill(STRINGS)
embark-custom-candidates()
embark-cycle(ARG)
embark-decode-url(START END)
embark-define-regexp-target(NAME REGEXP &optional TYPE TARGET BOUNDS LIMIT)
embark-define-thingatpt-target(THING &rest MODES)
embark-dired-candidates()
embark-dired-jump(FILE &optional OTHER-WINDOW)
embark-done()
embark-download-url(URL)
embark-dwim(&optional ARG)
embark-eldoc-first-target(REPORT &rest _)
embark-eldoc-target-types(REPORT &rest _)
embark-embark-collect-candidates()
embark-encode-url(START END)
embark-epa-decrypt-region(START END)
embark-eval-replace(NOQUOTE)
embark-export()
embark-export-apropos(SYMBOLS)
embark-export-bookmarks(BOOKMARKS)
embark-export-customize-face(FACES)
embark-export-customize-variable(VARIABLES)
embark-export-dired(FILES)
embark-export-ibuffer(BUFFERS)
embark-export-list-packages(PACKAGES)
embark-find-definition(SYMBOL)
embark-hash-md5(STR)
embark-hash-sha1(STR)
embark-hash-sha224(STR)
embark-hash-sha256(STR)
embark-hash-sha384(STR)
embark-hash-sha512(STR)
embark-highlight-indicator()
embark-history-remove(STR)
embark-ibuffer-candidates()
embark-info-lookup-symbol(SYMBOL)
embark-insert(STRINGS)
embark-insert-relative-path(FILE)
embark-insert-variable-value(VAR)
embark-isearch-backward()
embark-isearch-forward()
embark-isearch-highlight-indicator()
embark-keymap-help()
embark-keymap-prompter(KEYMAP UPDATE)
embark-kill-buffer-and-window(BUF)
embark-kill-ring-remove(TEXT)
embark-live()
embark-minibuffer-candidates()
embark-minimal-indicator()
embark-mixed-indicator()
embark-next-symbol()
embark-open-externally(FILE)
embark-pp-eval-defun(EDEBUG)
embark-prefix-help-command()
embark-previous-symbol()
embark-recentf-remove(FILE)
embark-rename-buffer(BUFFER NEWNAME &optional UNIQUE)
embark-rerun-collect-or-export()
embark-save-relative-path(FILE)
embark-save-unicode-character(CHAR)
embark-save-variable-value(VAR)
embark-select()
embark-selected-candidates()
embark-shell-command-on-buffer(BUFFER COMMAND &optional REPLACE)
embark-sorted-minibuffer-candidates()
embark-target-active-region()
embark-target-buffer-at-point()
embark-target-bug-reference-at-point()
embark-target-collect-candidate()
embark-target-completion-list-candidate()
embark-target-custom-variable-at-point()
embark-target-defun-at-point()
embark-target-email-at-point()
embark-target-eww-heading-at-point()
embark-target-expression-at-point()
embark-target-file-at-point()
embark-target-flymake-at-point()
embark-target-guess-file-at-point()
embark-target-heading-at-point()
embark-target-identifier-at-point()
embark-target-package-at-point()
embark-target-paragraph-at-point()
embark-target-prog-heading-at-point()
embark-target-sentence-at-point()
embark-target-smerge-at-point()
embark-target-text-heading-at-point()
embark-target-top-minibuffer-candidate()
embark-target-url-at-point()
embark-toggle-highlight()
embark-toggle-quit()
embark-toggle-variable(VAR &optional LOCAL)
embark-verbose-indicator()

Defined faces (11)

embark-collect-annotationFace for annotations in Embark Collect. This is only used for annotation that are not already fontified.
embark-collect-candidateFace for candidates in Embark Collect buffers.
embark-collect-group-separatorFace for group titles in Embark Collect buffers.
embark-collect-group-titleFace for group titles in Embark Collect buffers.
embark-keybinding-repeatFace used to indicate keybindings as repeatable.
embark-keymapFace used to display keymaps. Used by ‘embark-completing-read-prompter’ and ‘embark-keymap-help’.
embark-selectedFace for selected candidates.
embark-targetFace used to highlight the target at point during ‘embark-act’.
embark-verbose-indicator-documentationFace used by the verbose action indicator to display binding descriptions. Used by ‘embark-verbose-indicator’.
embark-verbose-indicator-shadowedFace used by the verbose action indicator for the shadowed targets. Used by ‘embark-verbose-indicator’.
embark-verbose-indicator-titleFace used by the verbose action indicator for the title. Used by ‘embark-verbose-indicator’.