products/sources/formale Sprachen/Isabelle/Tools/jEdit/dist/macros/Emacs image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: Duplicate_Line.bsh   Sprache: Unknown

Spracherkennung für: .bsh vermutete Sprache: Shell {Shell[65] PVS[79] CS[82]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

/**
 * Emulates the Emacs "set-fill-column" command, except that it prompts
 * for the new fill column instead of using an Emacs-style "prefix argument."
 */

source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));

void emacsSetWrap()
{
    // Convert the buffer name into a property name.

    propName = makeBufferPropertyName ("emacs.fillColumn.");
    
    // Get a value from the user.
    
    String err = "";
    int defaultWrap = getCardinalProperty (propName, getDefaultWrap());
    for (;;)
    {
        String s = Macros.input (editPane,
                                 err +
                                 "Enter new fill column or 0 to " +
                                 "reset to default",
                                 String.valueOf (defaultWrap));
        if (s == null)
            break;

        // Try to parse it.

        try
        {
            int i = Integer.parseInt (s);

            if ((i == 0) || (i == defaultWrap))
            {
                jEdit.unsetProperty (propName);
                break;
            }

            if (i > 0)
            {
                jEdit.setIntegerProperty (propName, i);
                break;
            }

            err = "Bad fill column value. ";
       }

       catch (NumberFormatException ex)
       {
           err = "Bad fill column value. ";
       }
    }
}

emacsSetWrap();


[ Dauer der Verarbeitung: 0.102 Sekunden  ]