Klinks
Cells may include hyperlinks that refer to other cells or to external sources of information. Explicit Hyperbole buttons may be created as usual with mouse drags (see Creation Via Action Key Drags). Implicit Hyperbole buttons may be added to Koutline text as well. A klink is a special implicit link button, delimited by <> separators, that jumps to a koutline cell and may also adjust the current outline viewspecs. This section discusses klinks.
There are three forms of klinks:
internal
‘<#2b=06>’ is an internal klink, since it refers to the koutline in which it is embedded. When activated, it jumps to the cell within the current outline which has permanent id ‘06’ and relative id ‘2b’. ‘<#06>’ does the same thing, as does ‘<#2b>’, though this latter form will not maintain the link properly if the cell is moved elsewhere within the outline. The form, ‘<#2b=06|ben>’ additionally sets the view spec of the current outline back to the default value, with a blank line between each cell and the whole outline visible.
external
The second klink format is an external link to another koutline, such as, ‘<EXAMPLE.kotl#3=012|c1e>’, which displays the named file, starting at the cell 3 (whose permanent identifier is 012), with the view specification of: blank lines turned off, cutoff after one line per cell, and showing ellipses for cells or trees which are collapsed.
view spec
The third format sets a view spec for the current koutline. For example, ‘<|ben>’, when activated, sets the view in the current outline to display blank lines, to use ellipses after collapsed lines and to label cells with the alphanumeric style.
Press the Action Key over a klink to follow it. This will flash the klink as a button and then will display its referent in the other window. If the klink contains a view spec, it will be applied when the referent is displayed.
There are a number of easy ways to insert klinks into koutlines. If you have mouse support under Hyperbole, simply click the Action Key within the indentation to the left of a cell text. If you then double click on some cell, a link to that cell will be inserted where you started. From a keyboard, use {C-c l} when in a koutline or {C-h h k l} when not in a koutline to insert a klink. Since klinks are implicit buttons, you may instead type in the text of the klink just as you saw them in the examples above and they will work exactly as if they had been entered with the insert link command.
If you prefer the standard copy and yank model that Emacs provides, place point within a klink when there is no active region and use {M-w} to copy the klink. To instead copy a reference to the current Koutline cell, use {M-w} outside of a klink when no region is active or {M-x kotl-mode:copy-absolute-klink-to-kill-ring RET} anywhere within a cell. Then {C-y} will yank the last copied text into any buffer you desire. Of course, when a region is active, {M-w} will copy the region as it does normally in Emacs.
Similarly, you can copy to an Emacs register rather than to the kill ring. When no region is active/highlighted, {C-x r s} prompts for an Emacs register and saves to it either the current klink or, when outside of a klink, a reference to the current cell. {M-x kotl-mode:copy-absolute-klink-to-register RET} anywhere within a cell saves a reference to the current cell to a register.
{C-x r i} with the same register then inserts at point the Koutline reference previously saved. When a region is active, these operate on the region instead.
There are also commands without any builtin key bindings that always copy a klink reference to the current cell:
kotl-mode:copy-absolute-klink-to-kill-ring
kotl-mode:copy-relative-klink-to-kill-ring
kotl-mode:copy-absolute-klink-to-register
kotl-mode:copy-relative-klink-to-registerBecause klinks use a very generic syntax, surrounded by <angle brackets>, in certain modes, mostly C-based programming modes, certain non-klink syntax can be mistakenly identified as klinks. Therefore, the Koutliner provides two customizable variables which disable klink recognition in selected major modes, klink:ignore-modes and klink:c-style-modes. Add a mode to one of these if you find any syntax that improperly registers as a klink.
klink:ignore-modes is for non-programming modes, as Hyperbole ensures that within all programming major modes, klinks are recognized only when point is within a comment.
klink:c-style-modes is rarely needed but is there if Hyperbole ever mistakenly recognizes a pattern within a comment as a klink when it isn’t.