rename link: doesn't destroy data, but you're on the hook now to make the global structure of the graph make sense to you.
clear link: extremely unsafe and might make notes unreachable if you're not careful.
QWWOAZ3P73XN74JBLI23YKM7KKRUCH55EMD7I6VPKG7B6DWZXB2QC OQIWNGD4Q7G5ZW7KTM6FUUEYX43DZ6LNP3Q5BXXLGE35QLU3LX5AC 47RPC7ATVC6VSS7X6EPD4NB6PHZ5OU4KR62N2PV5WDDIJPQMO4UQC QMWB3N3NKEACQBGY7JRFW5J74Z74CBLKJC2EDJJEDV7NKM2NQCGQC GQBUV2XOMEPMTXMPCBQWGGIUXGQDX77VTGPFIG6YT7G64ASOYHXQC CIOTARCZGYB3CVH6RMR2IGJ7UBKJAFOACPMCIGMHEXRCL63CKR6AC IZAQ4C7DZ3OTGUPDYVRYJPHO6HT67HL7DZLPNIPWINBHNNLK42OAC AUE2Y6HE5AIZVFO6EGLYNXKBDXGXJKDURTA4CFAEX6ZWRZKUCMUQC SYUCEGP3UTN76WUUAO7E2BDEZFRZILUZBKB6LG5C2N54SFGDU5LAC plan_draw()endfunction command.rename_link(args)local from, to = args:match('(%w+)%s+to%s+(%w+)')if from == nil thenfrom, to = args:match('(%w+)%s+(%w+)')endif Cursor_pane.col < 1 thenprint('no current note')returnendlocal pane = Surface[Cursor_pane.col][Cursor_pane.row]if pane == nil thenprint('no current note')returnendprint('renaming link', from, 'of', pane, 'to', to)if Cache[pane.id].links[to] thenprint(('%s already has a %s note'):format(pane.id, to))returnendlocal target = Cache[pane.id].links[from]local from_opposite = Opposite[from]Cache[pane.id].links[to] = Cache[pane.id].links[from]Cache[pane.id].links[from] = nilif Opposite[to] ~= Opposite[from] thenif Cache[target.id].links[Opposite[to]] thenprint(('target %s already has a %s note'):format(target.id, Opposite[to]))returnendCache[target.id].links[Opposite[to]] = Cache[target.id].links[Opposite[from]]Cache[target.id].links[Opposite[from]] = nilendschedule_save(pane)stop_editing(pane)endfunction command.clear_link(rel)if rel == nil thenprint('specify a link to clear')returnendif Cursor_pane.col < 1 thenprint('no current note')returnendlocal pane = Surface[Cursor_pane.col][Cursor_pane.row]if pane == nil thenprint('no current note')returnendif Cache[pane.id].links[rel] == nil thenprint(('%s has no %s note'):format(pane.id, rel))returnendprint(('clearing link %s of %s (used to point to %s)'):format(rel, pane.id, Cache[pane.id].links[rel]))Cache[pane.id].links[rel] = nilschedule_save(pane)stop_editing(pane)refresh_pane_height(pane) -- just in case this is the final link