Open swflint opened 3 weeks ago
No, unfortunately not. The reason is that there is no buffer visiting the database file. What Ebib does is read the contents of a .bib
file and store it in a hash table. Then when you save the database, it is written to a temp buffer, the content of which is then written (using write-region
) to the original file.
I don't immediately see an alternative solution... Perhaps visiting the .bib
file and enabling auto-revert-mode
in that buffer could work. Ebib shouldn't touch that buffer (it uses temp buffers to read and write the file, it never visits it), and auto-revert-mode
should ensure that when Ebib saves the database, the buffer is reverted. I don't know if that triggers after-save-hook
, but if not you could probably use after-revert-hook
to call gac-after-save-func
.
A little cumbersome, of course... Perhaps it makes sense to add some hooks to Ebib to make this easier.
That's about what I had expected. I may try to make a PR if I can get something working.
Would it be possible to call
after-save-hook
in the context of the buffer visiting a given database file? Not doing so preventsgit-auto-commit-mode
from operating like I'd expect.