Changeset 8714


Ignore:
Timestamp:
03/05/05 20:49:10 (16 years ago)
Author:
piso
Message:

markSexp()

Location:
trunk/j/src/org/armedbear/j
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/CommandTable.java

    r8692 r8714  
    33 *
    44 * Copyright (C) 1998-2005 Peter Graves
    5  * $Id: CommandTable.java,v 1.55 2005-03-03 19:27:31 piso Exp $
     5 * $Id: CommandTable.java,v 1.56 2005-03-05 20:49:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    315315            addCommand("man", "ManMode");
    316316            addCommand("manFollowLink", "ManMode");
     317            addCommand("markSexp", "LispMode");
    317318            addCommand("mouseFindOccurrence", "ListOccurrences");
    318319            addCommand("mouseFindTag", "TagCommands");
  • trunk/j/src/org/armedbear/j/LispMode.java

    r8679 r8714  
    33 *
    44 * Copyright (C) 1998-2005 Peter Graves
    5  * $Id: LispMode.java,v 1.92 2005-03-02 01:14:09 piso Exp $
     5 * $Id: LispMode.java,v 1.93 2005-03-05 20:48:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    8080        km.mapKey(KeyEvent.VK_F, CTRL_MASK | ALT_MASK, "forwardSexp");
    8181        km.mapKey(KeyEvent.VK_B, CTRL_MASK | ALT_MASK, "backwardSexp");
     82        km.mapKey(KeyEvent.VK_SPACE, CTRL_MASK | ALT_MASK, "markSexp");
    8283        km.mapKey(KeyEvent.VK_D, CTRL_MASK | ALT_MASK, "downList");
    8384        km.mapKey(KeyEvent.VK_U, CTRL_MASK | ALT_MASK, "backwardUpList");
     
    824825            if (pos != null)
    825826                editor.moveDotTo(pos);
     827        }
     828    }
     829
     830    public static void markSexp()
     831    {
     832        final Editor editor = Editor.currentEditor();
     833        if (editor.getMode() instanceof LispMode) {
     834            Position pos = mode.forwardSexp(editor.getDot());
     835            if (pos != null) {
     836                editor.addUndo(SimpleEdit.MOVE);
     837                editor.setMarkAtDot();
     838                editor.getDot().moveTo(pos);
     839                editor.setUpdateFlag(REPAINT);
     840            }
    826841        }
    827842    }
Note: See TracChangeset for help on using the changeset viewer.