/**
 * Emulate GNU Emacs's "exchange-point-and-mark" capability.
 * Does NOT use jEdit markers.
 */
source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));

void emacsExchangePointAndMark()
{
    int mark = getMark (buffer);
    if (mark == -1)
    {
        beep();
        return;
    }
    int point = textArea.getCaretPosition();
    setMark (buffer, point);
    textArea.setCaretPosition (mark);
}

emacsExchangePointAndMark();

