Skip to content
Bruce D'Arcus edited this page Jul 20, 2021 · 38 revisions

A single "entry" command?

A flat list of standard Emacs commands plus Embark gives a lot of flexibility.

If you come from helm-bibtex or ivy-bibtex and crave a shorter entry point, however, the simple solution is to define an alias to what you'd like to be your default command; like:

(defalias 'my/bibtex 'bibtex-actions-insert-citation)

Proactive reloading of library

This is a feature included out-of-box in ivy-bibtex and helm-bibtex, but I have elected to leave it out for now at least, hoping we can find a better solution.

The README includes a section on this. If you have other setups you use, put them here.

Note: it seems to me a solution based on watchexec might be better/easier. I just noticed straight.el uses this in its watcher script. For example, this should work if you are using the emacs daemon, running it from the directory that holds your bib files, and you want all of them watched:

watchexec -e bib emacsclient -u --eval "(bibtex-actions-refresh)"

Here's a possible elisp script. Feel to improve this (there may be some ideas in this file?):

(defun my/add-bib-watches (paths)
  "Add path watches for all PATHS."
  ;; TODO add message for success/failure; what about removal?
  (let ((flat-paths (-flatten paths)))
    (cl-loop
     for path in flat-paths
     do
     (file-notify-add-watch
      path '(change) 'bibtex-actions-refresh))))

(defvar my/bib-paths
 (list
  bibtex-completion-bibliography
  bibtex-completion-notes-path
  bibtex-completion-library-path
  "My bib paths."))

;; Add watches for all bib paths.
(my/add-bib-watches my/bib-paths)

Note: bibtex-comoletion sets up path watches for the bib file(s) automatically, and this currently cannot be turned off. This means if you use ivy-bibtex or helm-bibtex along with bibtex-actions for some reason, it's possible for you to end up with more than one call of bibtex-comoletion-candidates on a path change.

UI

(setq bibtex-actions-template
  '((t . "${=has-pdf=:1} ${=has-note=:1}	${author:24} ${title:64} ${year:4}")))

Using icons instead of plain-text symbols

All-the-icons

TODO

Nerd-fonts

TODO

Embark

Bind the keymap to embark-act like so:

(add-to-list 'embark-keymap-alist '(bibtex . bibtex-actions-map))

Easy access to the keybindings from embark-act

You have, again, options.

Default embark prompter

You can setup the default prompter per the embark README.

This commit also adds an option to use prefix completion.

Which-key

This variable will configure which-key to sort the bindings so the bibtex-action ones are grouped first.

(setq which-key-sort-order 'which-key-description-order)

tablist-mode

For marking candidates in the embark-collect buffer. TODO Still need code to bind this to embark.

embark-collect-direct-action-minor-mode

This allows you to bypass the embark-act command and invoke actions directly within a collect buffer.

Clone this wiki locally