joostkremers / ebib

A BibTeX database manager for Emacs.
https://joostkremers.github.io/ebib/
BSD 3-Clause "New" or "Revised" License
275 stars 37 forks source link

Make crossref fields clickable (like `file`, `doi`, etc.) #264

Closed Hugo-Heagren closed 2 years ago

Hugo-Heagren commented 2 years ago

Just thought this might be fun. I wanted crossref fields to be clickable, to open the relevant entry, after the fashion of file, doi etc. I followed the pattern used for those fields in my implementation.

I've got a couple of questions though:

joostkremers commented 2 years ago

Just thought this might be fun. I wanted crossref fields to be clickable, to open the relevant entry, after the fashion of file, doi etc.

Sure, why not.

I've got a couple of questions though:

* first, why is the functionality for clickability implemented with an ebib-specific mechanism (`ebib-index-open-at-point` and `ebib-entry-open-at-point`) rather than with the standard Emacs `button` libary and functions?

Probably because I was just copying from similar functionality in the index buffer (where the notes symbol and doi/url fields are clickable) without knowing what I was really doing.

I've used Emacs buttons a lot in my own display functions for the index buffer and they work great, but the ebib-specific stuff initially confused me.

* second, is there a reason there are separate functions for opening-at-point in the index and entry buffers?

The functions for the index buffer were originally provided by someone else and at some point I basically copied them for the entry buffer. I'm not familiar with buttons in Emacs and at the time I probably didn't even realise they existed.

It would make sense to replace the Ebib-specific stuff with more standard methods, but I have little time myself. I'd happily accept a PR, though.

Hugo-Heagren commented 2 years ago

It would make sense to replace the Ebib-specific stuff with more standard methods, but I have little time myself. I'd happily accept a PR, though.

Nice -- see #256 (including button library, and crossref stuff, so I'll close this PR as redundant).