-
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
add an "other window'/"other frame" option for opening notes #785
Comments
I agree it makes sense, but am not really sure how to do that, or if it should really be the domain of this package. If you're in an org buffer, isn't that an org config issue? Another wrinkle is it may be an org-roam or denote etc buffer. Related: https://emacs.stackexchange.com/questions/48683/open-org-mode-links-to-info-in-different-window |
This sort of thing is related to the problem that we're having in joostkremers/ebib#301. There, we're trying to use |
Perhaps an |
I'm not a Citar user and I'm not familiar with its source code, or its design goals, so I can't definitively say, but in general, I'd say that it's the package that provides the interactive command that should also take care of displaying the buffer. But for that to be possible, it needs to be given a buffer, but it seems that that's not guaranteed to happen with Citar. We're in the process of making Ebib's note-handling more open, i.e., making it easier to plug in a user's preferred note-taking system, and this is a problem we're running into. Ebib basically needs three things:
Points 2. and 3. require that Ebib be given a buffer. |
I agree, in general, but the general is doing some heavy lifting here. I think it's likely many users will want to use org-capture based workflows, and (for better or worse) there is no way to do so without having the notes backend handle display (and not citar/ebib). So I think that it would be good to design a system flexible enough to accomodate both:
This goes along with my suggestion here ('Concerning 2') that the notes backend should return different values in different circumstances:
This system could easily be extended too. For example, if needed, a window return means the buffer is displayed in that window but the window is not selected (and the driver app has to do that). I'm not sure who would need this, but it's the sort of thing which would be easy to do if necessary. In the extreme case, this whole return-val/behaviour pattern could be encoded in a customisable user var (an alist mapping predicates on the return value to handler functions) so users could write their own handlers if need be. I think this is probably unnecessary, but it's the sort of thing you could do. (Of course, it would also be really nice if the system allowed for different kinds of display, in other-window, other-tab, etc. but that's a separate thing.) |
Yes, absolutely. It's what Ebib already allows when creating a note (because you can use org-capture for that). It would be easy to allow that for opening a note as well.
👍 Ebib uses (if-let ((buffer (funcall ebib-notes-backend :open-note key)))
(pop-to-buffer buffer))
That's what |
Seems much of the recent back-and-forth is about ebib. What, if anything, do we need here? Does this impact our note API at all? |
They are both "private" functions, so we didn't anticipate other packages using them. @aikrahguzar @roshanshariff - any thoughts on this? |
Indeed. 🙂
Well, for Ebib it would be very helpful if there were guarantees about the return values of the functions in
Currently, Ebib assumes that The design on Ebib's side is not set in stone, so I'm open to alternatives. |
But I assume Citar has a public API for opening and creating notes? (Or is that a silly assumption? Like I said, I don't use Citar.) Or interactive functions? |
It does; it's a key feature. Aside: I was noting that just to explain; not to suggest I'm opposed to making any changes. Here's an example of its use in So a possibility is we slightly change that API in ways that are more flexible (specifically, making the |
👍
I didn't take it that way. 🙂 I just don't want to give you the impression I'm demanding changes to Citar.
Our difficulty is that we don't want to define functions for the actions that Citar's API defines ( |
Maybe we also add public variants of those functions that correspond to the updated, tighter, API requirement? It seems a little odd, now that I look at it, that the default notes config for citar uses those "private" functions. Line 445 in 07d2a63
So the updated API description could be something like (feel to suggest improvements; this is just a strawman):
|
@localauthor @pprevos - we're discussing possibility of a small breaking change to the notes API. Any input? |
Thanks for the head-up. I am not fussed with changes, as long as I know how to hook into Citarwith Denote. Is there a version to test yet? |
This is what Ebib currently expects:
If that sounds a little arbitrary, then you're probably right. Historic reasons... Especially the error handling is unfortunate, I think. So I'm not against making changes to Ebib. Conceptually Ebib requires these actions (apart from
Ebib currently collapses
Obviously, I'm reasoning from my perspective, which is based on what Ebib currently offers and what it would need in order to interface with other notes back-ends without changing any of its front-end code. That shouldn't be taken as a requirement, though. |
No. If and when there is, it will be linked here. Obviously, someone will have to dig into the code and figure out what would be involved in the suggested changes. I suspect it should be fairly trivial, but haven't looked at it myself yet. |
Is your feature request related to a problem? Please describe.
I often want to review a note I have on a reference while writing text including that reference (by pressing
RET
on the cite link etc). atm, the note replaces the the buffer of the text I'm working on.Describe the solution you'd like
I'd like to have the possibility of opening the note in another window/frame
Describe alternatives you've considered
I can always split the window first, and then access the cite link
Thanks!
The text was updated successfully, but these errors were encountered: