-
Notifications
You must be signed in to change notification settings - Fork 54
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
refactor: add optional parameter to refresh command, update docs #76
Conversation
@wenjie2wang - couple of things on this, if you have time and interest:
|
bibtex-actions.el
Outdated
"Add watches using 'file-notify-add-watch'. | ||
For the paths specified in 'bibtex-actions-watch-list' will add a | ||
watch that runs 'bibtex-actions-refresh' upon a change." | ||
;; TODO return message of success or error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to do this!
Thanks, @bdarcus !
It is great to have a simplified interface.
I can help test them after work (I wish I knew more about Elisp and help you more on it). IMHO, the current |
Probably if in doubt, I shouldn't include the commands at this point then.
OK, thanks. It could be that I remove the commands, etc., and simply update the refresh command and README. Let me know WYT after you have a chance to test. |
Another option, if we get it working, is to include an example in the README like what I'm trying to do here: I added this to the wiki, so people can easily improve it. https://github.com/bdarcus/bibtex-actions/wiki/Configuration#automating-path-watches |
Yeah, we call two different callbacks on the same paths. But note: in bibtex-actions, I no longer use the bibtex-completion-init function, which is what sets those up. So that should only happen if you use both bibtex-actions and ivy/helm-bibtex. Edit: I will see if I can amend the example script on the wiki to first remove existing watches, and add a note about this issue. So in the end, you think once I remove the new commands, this is ready to merge? |
You are right. If I only use bibtex-actions, there will not be such an issue.
Yes, this PR looks good to me. Thanks! |
This allows us to avoid using a lambda on the file-notify callback.
Oops, sorry @wenjie2wang, I accidentally deleted your earlier comment with the code example you used from bibtex-completion. I had want to reply to note since that code is now on the wiki, we (and others) can experiment with how to improve it. What I merged ended super simple then: just makes the setup simpler. |
Update
bibtex-actions-refresh
to allow it be invoked as a callback onfile-notify-add-watch
without requiring a lambda.Also update the README to incorporate the change.
Relates to #73.