-
Notifications
You must be signed in to change notification settings - Fork 74
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
Request for helm-bibtex-notes-file #40
Comments
I considered storing all notes in one file when I first wrote helm-bibtex. The reason why I decided against it is that in my experience Emacs can be really slow with bigger org files. So I thought that the one-file solution may not be scaleable. Are there any true benefits of having all notes in one file or is this just a matter of personal preference? If a one-file solution were to be added, I think we would simply recycle the variable
where I'm just thinking aloud here. I'm not planning to work on this and I may not even accept a pull-request. At the moment, it seems to me that the one-file approach is neither better nor worse than the approach using multiple files and I don't see why we need two solutions for storing notes. |
The reason for using one file would be to extend the flexibility of helm-bibtex. People have different approaches. Some work better than others. Personally, I've always used one file and never had problems with speed, even when having to retrieve from drawers. Some of the benefits of using one file is to be able to (1) export all or some of the notes to html, pdf etc.; (2) search with helm-swoop or occur/org-occur; (3) sort and move notes to different subtree categories. Another advantage is that the note heading and metadata are added automatically using the information provided in the bib file, which avoids having to name files in a separate directory. |
Ok, convinced, and I may actually switch to the one-file approach when the code is ready. I will probably introduce a customization variable that allows users to define their own template for notes. Something like the following could be used to implement your proposal.
|
Could you please test the version in the new branch note-files? To configure it, all you have to do is to set One issue: when existing notes are searched, the code simply looks for the first occurrence of the BibTeX key in the notes file. If that key is used in the notes of another publication ("This paper reports a failed replication of XYZ", where XYZ is the BibTeX key), you might land there. Not sure how to deal with this. |
I tested and it's working fine, expect the subtrees are not showing. This is what I would expect to see:
This would be my suggestion:
I'm not sure I understand your issue. Why would you reuse the key? |
Here's an example:
The |
In a89bde5, I added something similar to what you suggest: the complete subtree for the publication's notes is made visible and all other trees are hidden. |
I see the problem. Could you exclude the brackets from the search? |
Before I saw this issue, I made a hack: http://pastebin.com/r8NuSNKv I will have to give the branch a try. As for the search problem, why not use ":BIBTEX-KEY: Key2" instead of just "Key2"? |
Just made a pull request (my first one ever!) but there is another issue with this branch that I couldn't solve. The |
Thanks for the PR. I'll look at it on the weekend. The reason why I hesitated to make a decision is that, once people start using a certain format, making changes is going to be hard. |
I see... Well for now anyway, aside from the |
Still thinking about the best way to use and detect BibTeX keys in the notes file. What about this solution:
I think this is an appropriate use for Org tags and if we search for |
That's a big change. As far as I know, most people are using properties, which doesn't mean that it's any better. I'd be happy to give the tag method a try and see how it goes. Another solution would be to implement both methods, so that if no tags are found, |
The code for the property drawers is not yet merged into the official version. So I doubt that most people are using drawers at the moment. However, I understand that it would be inconvenient for you to transition to a solution using tags. If I decide to implement it with tags, I will try to make it easy for you to stick with property drawers. Shouldn't be too difficult. |
|
I don't use org-ref. Are you saying that org-ref already has support for notes and that it is using property drawers? |
It does support notes. As far as using properties drawer, I believe so. |
Thank you, @llcc. I don't understand why they duplicate the information from the BibTeX entries. If something changes (e.g., a paper goes from in press to published online, or from published online to published in print with page numbers etc.) you have to change the BibTeX entry and the notes file. Also, I don't see a BibTeX key (the name |
I'm also not sure why it's duplicated, unless it's able to sync with the bib file, which I doubt. The only information really needed is the bibtex-key under |
I updated the note-files branch. There are several changes: When one big notes file is used:
Multiple notes file (one for each publication):
Please test and let me know if that works for you. If everything works as expected, I will merge these changes into master. Thank you. |
I get an error
|
Thanks for testing! Which version of Emacs are you using? I'm on the development version. |
24.5.1 |
I'm having a few problems. Pressing |
Thanks for the feedback. Another user also reported these issues. So far, I haven't been able to reproduce them on my system (apart from inserting at the top, of course). Weird. I'll try with an older version of Emacs. |
In jagrg@6c82d40, I was able to make the notes-file branch work. With |
Hm, I can't see what your changes were. Can you commit your changes into the current note-files branch (without changes from master) instead of making a new branch? |
The notes-file branch was too old to merge. |
There were a couple of problems which I hope are resolved in this commit: 282f507 |
Looks good, Titus, except you brought back the problem of templates being inserted on top of the file. I would suggest replacing |
To be honest, I chose insertion at the top because it didn't work at the bottom. I think I'm hitting a bug in Emacs but don't have the nerve or time to track it down. Ok, regarding |
I also think it's a bug. In any case, my notes branch works well with a single file, so maybe we could try splitting the function with a variable to choose between one or multiple files. This means that when the variable is set to one-file, only the one-file function is called. Just a thought. No pressure! (defun helm-bibtex-edit-notes ()
(if (eq helm-bibtex-use-multiple-files t)
(helm-bibtex-edit-notes-from-multiple-files)
(helm-bibtex-edit-notes-from-single-file))) |
Appending at the end now seems to work reliable. I have a vague sense of what the problem was. Probably an Emacs bug. The code now uses org-show-subtree but follows up with org-cycle-hide-drawers. My impression that this feature is now finally complete and working correctly. Any objections against merging into master? |
You solved the puzzle. Thanks! |
I added this feature in 5d028b9. I did not merge the branch because the commit history was fairly messy. Thanks everyone for your input. |
Instead of storing my notes in a separate directory, which I think is what helm-bibtex proposes, I like to keep my notes in one org file, which looks something like this:
So I was wondering if you could add "helm-bibtex-notes-file", which would be the equivalent of "helm-bibtex-notes-path". But instead of searching for the bibtex-key.org file, it would search for the bibtex-key in the file specified by the user, for example:
The text was updated successfully, but these errors were encountered: