Skip to content
Bruce D'Arcus edited this page Nov 28, 2021 · 23 revisions

embark-become

This command allows you to take the input you use for one command, but pipe it to another.

That can be used to configure something similar to the "fallback" behavior you see in helm-bibtex and ivy-bibtex.

In order to configure that, you use a keymap, just as with embark-act. Here's an example for biblio lookup services, which in this case will be available if you are using citar-open-library-files:

;; define the keymap
(defvar my-citar-embark-become-map
  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "f") 'citar-open-library-files)
    (define-key map (kbd "x") 'biblio-arxiv-lookup)
    (define-key map (kbd "c") 'biblio-crossref-lookup)
    (define-key map (kbd "i") 'biblio-ieee-lookup)
    (define-key map (kbd "h") 'biblio-hal-lookup)
    (define-key map (kbd "s") 'biblio-dissemin-lookup)
    (define-key map (kbd "b") 'biblio-dblp-lookup)
    (define-key map (kbd "o") 'biblio-doi-insert-bibtex)
  map)
  "Citar Embark become keymap for biblio lookup.")

;; tell embark about the keymap
(add-to-list 'embark-become-keymaps 'my-citar-embark-become-map)
Clone this wiki locally