-
Notifications
You must be signed in to change notification settings - Fork 37
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
Improve ebib citar #301
Improve ebib citar #301
Conversation
@swflint , thanks, I pulled in your changes, and made some cosmetic changes myself. I've also removed the option I also added actions for |
I would support raising an error here. As Steve Purcell once said:
|
A warning (with However: with this design, it's the responsibility of backend writers to error or warn when they choose not to implement some bit of functionality. |
Hmm, I didn't think of Anyway, to the topic at hand: I actually now also think it makes sense to issue an error or at least a warning: even though Perhaps, though, it would make sense to change the default value of |
I saw
I can agree with that, though again, I think a warning makes more sense than an error. That said, if we're using
I think that is a reasonable change. It's a fairly simple one, and given the use of an external system for notes management, that should work. However, as I noted in #299, we'll need to make sure that focus eventually ends up in the right place (i.e., the index buffer) when notes are shown. |
Yes. Probably my next project: replace
👍
Yes, I agree. I've only used an error in cases where the error is a direct response to a user command, though, so it's almost like a warning, and I've been using Still,
In the system as I envisage it, the back-end makes sure the buffer exists but does not display it nor select it. It just returns the buffer info, after which it's up to Ebib to display it and possibly select it (in case the note was opened for editing). The reason is that displaying the note and editing both use The exception is If those assumptions don't work for Citar, we should discuss how we can handle it. |
I agree that is ideal. I've tried to prevent the buffer from being displayed, but, even in the most basic notes configuration (
That makes sense.
Agreed. I think the assumptions work in general, we may just need a bit more careful coding to make the focus work correctly with a Citar backend. |
Sorry I haven't been following the discussion as closely as I could have, but...
If I understand you correctly, I can say that these assumptions are not consistent with citar, as I discussed here. The important point is bullet point 2. It is possible to write a backend, entirely consistent with citar's system, which does all the buffer handling itself, including opening and displaying the buffer and selecting the window in which it is displayed. In this situation, it might not be (easily) possible to return a buffer at all. |
For For So the question is, what is possible with Citar? Does opening the note always select the note buffer? In that case, we might split up We could also allow I'm open to making chances to Ebib to make the Citar back-end work. I just need to know which changes to make... 🙂 |
AFAICT the API is not properly documented. But here is what I can find. Citar expects the notes backend will include a plist with (some of?) the following keys:
(defun my/citar-open-org-roam-note-title (note-title)
"Capture to the Org Roam node with with title NOTE-TITLE."
(when-let ((node (org-roam-node-from-title-or-alias note-title)))
(org-roam-capture- :node node)))
(defun citar-create-note (key &optional entry)
"Create a note for KEY and ENTRY.
If ENTRY is nil, use `citar-get-entry' with KEY."
(interactive (list (citar-select-ref)))
(funcall (citar--get-notes-config :create) key (or entry (citar-get-entry key)))) As you can see, citar just selects a key/entry pair, and then calls the function in
Does that help? There's some other stuff ( |
Sorry, to come back to your concrete question:
Citar's notes API does not ensure that it does. I imagine most users who write custom setups will (themselves, in the code for those setups) ensure that it does, but this is independent of citar. |
That the Citar API is not well-documented in this regard is certainly making it more difficult. There's an open issue about display, and whether or not it's even in the purview of Citar (emacs-citar/citar#785). I'm going to comment and ask for clarification there as well. |
No description provided.