-
Notifications
You must be signed in to change notification settings - Fork 55
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
Make citar-{bibliography,library-paths,notes-paths} safe local vars #800
Conversation
Thanks for this! Can you please clarify, including in the README, how and why one would use this, rather than just local bibliographies? Also, while I can just squash the commit(s) and rewrite the commit message, note that we've been using conventional commit guidelines recently. If you're comfortable rewriting history yourself, that would save me the trouble ;-) |
Conventional Commits are new to me—I've seen them but not used them. Would you consider this a |
OK @bdarcus I've updated the commit message and added a little blurb in the README—happy to expand if you'd like.
Magit makes this dangerously easy. :) I can't imagine using Git now without it. In fact, I opened this fork and PR entirely with Magit+Forge! While I've got your attention, thank you so much for making this. The other day I was writing up a long blog post, and I was so thrilled that I could use the exact same workflow for adding citations to my blog (using ox-hugo) as I do for writing papers. ❤️ so cool |
I'd also like to hear about your workflow @ashton314. For the bibliographies, perhaps it makes more sense to have a separate buffer-local variable, perhaps And while I can also see the utility in project-specific notes, I'm curious to learn how you're using per-project library paths. I'm not opposed to marking these variables safe-local, but first I'd like to understand if there are better ways of accomplishing the purpose you had in mind. For instance, just overriding these variables locally makes it hard to do things like configurably combining local and global paths. |
Yes. You'd want the first line of the commit message to be 50 characters max, and lowercase. Thanks for the README addition, but I'm still not totally clear, nor it seems is @roshanshariff. Could you please respond to him? |
Hey—sorry for the long wait. Semester started and I got inundated. 😅 Surfacing now! I used a local value for % Local Variables:
% jinx-local-words: "..."
% citar-bibliography: ("./ref.bib")
% End: I was collaborating with several other authors—this made it nice for me to scope citar's UI to just the papers that we had in our bibliography. If a ref I wanted was missing from the list, it was a good clue for me to go back to my personal I'll confess I haven't actually used the other two variables: they seemed like good variables to change in tandem with the If going the route of a buffer-local variable, I think it might be nice to have a switch or some kind of narrowing key to restrict citar results to only what is available locally. That way a missing ref in the project-specific |
If you'd prefer; I'll narrow the scope of this PR to just updating the |
I think this is related to #695.
I'm unsure, since safe local variables are new to me. Let's see if @roshanshariff has further input, though I know he, like us, is busy. |
Maybe we can think of the two requested subfeatures separately?
|
And if they aren't, why not? The advantage of how we do things now is what local files tex, org etc see is the same as what citar sees. |
I think this is a big advantage and reading the discussion, it seems like the same use case can be met by just unsetting the |
(Hey, sorry again for the super long delay. I've been slammed this semester.) I didn't realize that citar would read what tex and org see—that's perfect. In that case, I am in favor of making |
Putting the `safe-local-variable` attribute on a variable makes it so that it can be customized in `.dir-locals.el`, in the `-*- ... -*-` header line, or in a `Local Variables` block at the end of a file without the user getting a prompt whether or not to allow this. `citar-bibliography`, `citar-library-paths`, and `citar-notes-paths` all are ripe for per-directory customization. For instance, when working on a paper with collaborators, you might store a bibtex file specific to your project adjacent to the paper. Suppose your bibliography file is called "custom_refs.bib"; you can put % Local Variables: % citar-bibliography: ("./custom_refs.bib") % End: At the end of the file, and now whenever citar is invoked, it will pull up references from just that bibtex database and not whatever `citar-bibliography` is set to globally.
@bdarcus I think this is ready now! Thanks all for your patience. |
Citar uses local bibliographies in addition to those set in So if your collaborators don't use Citar themselves, they will have no global bibliographies and only local ones will be used. If they do have global bibliographies set up, I'm not sure they would expect Citar to automatically, without warning, ignore them when inside a particular project. I see that you prefer the global bibliographies to be suppressed for certain projects, but since allowing this is a personal preference, it naturally belongs in your own private configuration? |
Per Roshan's explanation, and in #831 (comment), I am closing this. Thanks for the PR, @ashton314, but we'll need to find another way (which Roshan suggests in the above linked comment). |
It is incredibly handy to customize
citar-bibliography
as a directory-local variable on a per-project basis. This worked so fabulously with the paper I just finished that I can't see myself not using this workflow again. I think a lot of people would like to use Citar in this way too.I've added autoload cookies to put the safe local variable predicate on the symbol; the predicate is simply a list of strings. I followed how Denote by Prot was setting the safe local variable predicate on some denote variables.