biblio.el icon indicating copy to clipboard operation
biblio.el copied to clipboard

Target buffer selection

Open aikrahguzar opened this issue 2 years ago • 4 comments

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.

aikrahguzar avatar Mar 18 '22 22:03 aikrahguzar

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

  1. rename biblio-target-buffer-default to something like biblio-get-default-target-buffer
  2. declare a new customizable variable biblio-target-buffer-default
  3. adjust the logic in biblio-get-default-target-buffer to respect the value of biblio-target-buffer-default, if set, and if not, to proceed with the lookup logic that it already has.

dankessler avatar Apr 21 '22 19:04 dankessler

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.

dankessler avatar Apr 21 '22 19:04 dankessler

Came across a few typos in docstrings

Thanks I fixed these.

aikrahguzar avatar Apr 22 '22 20:04 aikrahguzar

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.

aikrahguzar avatar Apr 22 '22 20:04 aikrahguzar