I have a handful of org-remark
highlight-annotations which, before a bug in the code-base got fixed, consistently got displaced by 40 characters when I left and returned to the buffer.
In order for the highlight to make sense, I need to manually adjust org-remark-beg
and org-remark-end
property values back to their original positions, as shown below.
*** sample note
:PROPERTIES:
:org-remark-beg: 6590 -> 6630
:org-remark-end: 6611 -> 6651
:org-remark-id: 9c8548c9
:org-remark-label: nil
:END:
It is very tedious to do the calculations and make the adjustments manually for each note, especially when there are more than a dozen of these to fix. And you have to readjust the same set of notes over and over again.
Given the power of Emacs, I was just wondering if there is a lispy
way of programmatically fixing this problem.
Update:
Did some further research and here's what I've found:
org-property-actions
allows us to set and/or compute org property values. we just have to do a search-forward
to the region and call that function programmatically, or with C-c C-c
.
I get, however this error when I try to do the above:
org-compute-property-at-point: No operator defined for property org-remark-beg
So my follow-up, more specific question would be: how do we define a compute operator for a limited set of property tags? (i.e. not all org-remark-beg
etc. need to be adjusted.)