Skip to content
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

Fixing body functions and defining the "body" of a node #2

Open
legalnonsense opened this issue Sep 2, 2020 · 5 comments
Open

Fixing body functions and defining the "body" of a node #2

legalnonsense opened this issue Sep 2, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@legalnonsense
Copy link
Owner

Taken from reddit (https://www.reddit.com/r/emacs/comments/iks94o/annrfc_orgclones_orgmode_headings_in_multiple/)

Consider a heading containing list with checkboxes. If the heading has RESET_CHECK_BOXES property set to t, org-mode will attempt to modify the checkboxes in the heading body. Not sure if cursor-sensor-mode will catch this edit. Even if it does, org-mode will error unexpectedly.

Similar problem may happen when one uses default setting for org-log-into-drawer (nil). Adding notes involves org-add-note, which uses separate buffer to get the note text and then inserts the note text into the heading body.

Finally, one may use capture template to add a new list element or table line into cloned headline. I suspect that crazy staff may happen in such a scenario.

@legalnonsense legalnonsense added the bug Something isn't working label Sep 2, 2020
@legalnonsense legalnonsense self-assigned this Sep 2, 2020
@legalnonsense
Copy link
Owner Author

Capture template problem seems solved with adding (sync-clones) as a hook to org-capture-after-finalize-hook. One down, two to go.

@legalnonsense
Copy link
Owner Author

It is easy enough exclude a note added with org-add-note. If the goal is to include them, then it is more complicated because it does not seem like org-add-note runs any associated hook. I guess you could do it via advice.

@legalnonsense
Copy link
Owner Author

legalnonsense commented Sep 3, 2020

Also none of these editing functions trigger the cursor sensor, so there's no issue with read-only properties, and drawers following a headline are not considered part of the body, so logging into a drawer would not need to be synced unless the logbook is elsewhere in the body, so I guess it is the same problem involving org-add-note and the same advice would solve it.

@yantar92
Copy link

yantar92 commented Sep 3, 2020

It is easy enough exclude a note added with org-add-note. If the goal is to include them, then it is more complicated because it does not seem like org-add-note runs any associated hook. I guess you could do it via advice.

That probably make sense to exclude notes - they are often associated with TODO keyword changes. Since TODO keywords are not synced, there is little reason to sync the notes.

@yantar92
Copy link

yantar92 commented Sep 3, 2020

, so logging into a drawer would not need to be synced unless the logbook is elsewhere in the body, so I guess it is the same problem involving org-add-note and the same advice would solve it.

The problem is probably not when logging is done into drawer. By default, logging is done outside drawer, directly into the heading body.

@legalnonsense legalnonsense changed the title Check boxes and capture templates changing body contents Fixing body functions and defining the "body" of a node Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants