Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate find-note-file lambda in prepare-entry #311

Merged
merged 3 commits into from
Apr 16, 2020

Conversation

zaeph
Copy link
Contributor

@zaeph zaeph commented Apr 14, 2020

Allows other packages to patch note-file-finding function without changing the
default behaviour of helm-bibtex.

This was prompted by #309.

Allows other packages to patch note-file-finding function without changing the
default behaviour of helm-bibtex.
@tmalsburg
Copy link
Owner

tmalsburg commented Apr 15, 2020

Great! But I think we should allow bibtex-completion-find-note-file-fn to be a list of functions in case the user has notes in multiple places. This approach would also mirror what I'm intending to implement for finding PDFs. There, it will be useful as well to collect PDFs using multiple methods, e.g., by using the info from the entry's file field and by checking for CITKEY.pdf.

@zaeph
Copy link
Contributor Author

zaeph commented Apr 15, 2020

But I think we should allow bibtex-completion-find-note-file-fn to be a list of functions in case the user has notes in multiple places.

I'm on it.

@zaeph
Copy link
Contributor Author

zaeph commented Apr 15, 2020

But I think we should allow bibtex-completion-find-note-file-fn to be a list of functions in case the user has notes in multiple places.

I'm on it.

I've implemented it in 1083278.

@zaeph
Copy link
Contributor Author

zaeph commented Apr 15, 2020

Note that we're only handling the detection of files here, not their creation. To do that, the best way would be to implement fully-fledged org-capture templates, as discussed in #263.

@zaeph
Copy link
Contributor Author

zaeph commented Apr 15, 2020

Note that we're only handling the detection of files here, not their creation. To do that, the best way would be to implement fully-fledged org-capture templates, as discussed in #263.

As it stands, the code could be modified here, but I really don't think it'd be a good idea to play with it until we've refactored the templating with org-capture.

@tmalsburg tmalsburg changed the base branch from master to notes-finder-plugins April 16, 2020 12:12
@tmalsburg tmalsburg merged commit 72c6748 into tmalsburg:notes-finder-plugins Apr 16, 2020
@tmalsburg
Copy link
Owner

Merged into a feature branch because I'd like to handle one-file notes also via this infrastructure.

@zaeph
Copy link
Contributor Author

zaeph commented Apr 16, 2020

Merged into a feature branch because I'd like to handle one-file notes also via this infrastructure.

Sure, let me know if you need a hand!

@tmalsburg
Copy link
Owner

Thanks, see here: 285f518

I've made bibtex-completion-find-note-functions (formerly bibtex-completion-find-note-file-fns) a defvar instead of a defcustom because this is only the first step toward real modularity. There are multiple places that need to be changed before we can flexibly replace notes styles/plugins, first and foremost bibtex-completion-edit-notes.

@zaeph
Copy link
Contributor Author

zaeph commented Apr 16, 2020

Thanks, see here: 285f518

I've made bibtex-completion-find-note-functions (formerly bibtex-completion-find-note-file-fns) a defvar instead of a defcustom because this is only the first step toward real modularity.

That looks pretty good to me. Sorry that I didn't modularise bibtex-completion-find-note-one-file whilst I was at it yesterday, it would have saved you some time.

There are multiple places that need to be changed before we can flexibly replace notes styles/plugins, first and foremost bibtex-completion-edit-notes.

Yup, but we've made a good start here. Good work! 🎉

@tmalsburg
Copy link
Owner

Sorry that I didn't modularise bibtex-completion-find-note-one-file whilst I was at it yesterday, it would have saved you some time.

No worries. Your PR was a good start!

@zaeph zaeph deleted the find-entry-fn branch April 25, 2020 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants