jed-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Temporarily leaving C Mode?


There many times when I want to paste into Jed while
editing a .c file in C mode, via Konsole(KDE's
terminal program) and want to paste in plain text
mode.  I've tried to use set_mode(), but that didn't
change ^M to plain old newline.  Is there a better way
to do the following?

Thanks, 

Ryan


static variable Raw_Mode_Flag = 0;

define ryan_rawmode ()
{
    variable km = what_keymap();
    if (strcmp (km, "C")) {
        message (strcat ("in ", km, " mode, doing
nothing!") );
        return;
    }

    if (Raw_Mode_Flag == 0) {
        Raw_Mode_Flag = 1;
        undefinekey ("^M", km);
        definekey("newline", "^M", km);
        undefinekey ("^I", km);
        definekey("text_indent_relative", "^I", km);
        undefinekey ("{", km);
        definekey("self_insert_cmd", "{", km);
        undefinekey ("}", km);
        definekey("self_insert_cmd", "}", km);
        undefinekey (":", km);
        definekey("self_insert_cmd", ":", km);

        message ("RAWMODE");
    } else {
        Raw_Mode_Flag = 0;

        undefinekey ("^M", km);
        definekey("c_newline_and_indent", "^M", km);
        undefinekey ("^I", km);
        definekey("indent_line", "^I", km);
        undefinekey ("{", km);
        definekey("c_insert_bra", "{", km);
        undefinekey ("}", km);
        definekey("c_insert_ket", "}", km);
        undefinekey (":", km);
        definekey("c_insert_colon", ":", km);

        message ("C MODE");
    }
}



		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]