-
Notifications
You must be signed in to change notification settings - Fork 109
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
using org-ql to edit org document? #373
Comments
As you said, org-ql is a query/search library. What your code does with the results is up to you. If you need a library to help with editing, maybe this can help: https://github.com/ndwarshuis/org-ml
If you're sure that's the problem, please report a bug to the Org mailing list so it can be fixed. |
@alphapapa thanks for response. I was not seeing org-ml-update , so i can use it as to edit the node.
I'll do if I'm convinced, since encoding needs to be told explicitly, i might need to set somewhere default encoding for org file is utf-8 or something. (so it might be my lack of system setup) Thank you for support I can see using org-ql to selecting the nodes to edit, and modify using org-ml on selected nodes. just in my short experience, I think org-ql can be useful when updating because it provides tool to select the nodes to edit.
If I happen to have more needs to update using org-ql (and org-ml)
If I may propose, |
IIUC, you needn't bother about those complicated patterns. Just perform the edit in the Alternatively, you could return a marker rather than an integer position, collecting a list of markers. Then use
It's good to keep that in mind, but since this is your own code, what would be killing the buffer too soon? |
wow, thanks for the response. So it was the I thought cutting element from source buffer somehow disrupts org-ql-select , selecting next node. But it was About buffer, I provided files and since org-ql-select opened the buffer, Now, looking at org-ql-select code, it advances with
Thank you for taking time to point it out. |
I can't say I understand exactly what you mean. But:
Unless your action function actually deletes the heading, I don't think this will be a problem.
Yes, every position after the first heading is part of an "entry" under a heading. There is no non-entry content after the first heading position, nor any between-entry content. |
Yes that's exactly what I'm doing, I'm doing similar thing as With two operationsm I'm trying to collect items into a buffer and sends it back to where it came So, this kind of operation is not typical I guess, org-ml also doesn't seem to expect this kind of operation (I can't cut and paste somewhere because org-ml doesn't expect someone to change
Thank you for letting me know! |
I am trying to carry-over todo items, (similar to what org-journal carry over does)
I used org-ql to do query what I want to carry over.
Here's the code.
I had some perplexing bug on putting
only when cursor at source buffer is at the end of the end.
Caused my code to not correctly carry-over.
I was suspecting many things, but it turned out
(org-element-at-point) is buggy with non-ascii character (in my case Korean, I guess I'll have to put some encoding hint at the top of file or somewhere)
Since I didn't know what the cause was, I also suspected it might be related to org-ql (specially how it caches..)
But it was not.
@alphapapa Thanks for saying to ask for help. While I prepared the question, I found the bug.
I ask a general question, since org-ql seems to be supporting "query" not "replace or edit" I was wondering if I was misusing library or if there are things I need to know when using it for editing. (maybe too general question.. but I 'll be glad if I can get any hints)
and the test org doc is
The text was updated successfully, but these errors were encountered: