biblio.el
biblio.el copied to clipboard
Target buffer selection
Makes the default choice target buffer sensitive to the major-mode of the buffer from which the search was started.
Also changes the behavior of biblio--selection-change-buffer
. Now it only offers buffers with major mode derived from frombibtex-mode
. This uses directory-name-p
with requires emacs 25.1 but can be avoided.
This looks really useful! :)
As I discussed in #54, I think it'd be nice to support the use case where the user (or a calling library) can just specify precisely what buffer should be used.
I think you could accomplish this by
- rename
biblio-target-buffer-default
to something likebiblio-get-default-target-buffer
- declare a new customizable variable
biblio-target-buffer-default
- adjust the logic in
biblio-get-default-target-buffer
to respect the value ofbiblio-target-buffer-default
, if set, and if not, to proceed with the lookup logic that it already has.
Assuming we can get this integrated, I think this would set the stage for a nice enhancement in helm-bibtex
and likely many other tools, where a nigh top-level let
form can be extended to bind biblio-target-buffer-default
to something sensible, e.g., for helm-bibtex
we could add (biblio-target-buffer-default bibtex-completion-bibliography)
to the list of bindings inside the let*
form.
Came across a few typos in docstrings
Thanks I fixed these.
This looks really useful! :)
As I discussed in #54, I think it'd be nice to support the use case where the user (or a calling library) can just specify precisely what buffer should be used.
This seems like a good idea to me so I implemented it but directly. biblio-lookup
takes three optional arguments the last of which is the target buffer. biblio-target-buffer-functions
machinery is used only if no target buffer is passed. That seemed like a better way to doing this than through a variable.