Ignore:
Timestamp:
May 23, 2005, 2:19:39 AM (20 years ago)
Author:
bird
Message:

Some emacs fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VSlickMacros/kdev.e

    r289 r290  
    23232323    if (sVar == '' || sVal == '')
    23242324        return -1;
    2325     //say 'k_style_emacs_var: 'sVar'='sVal;
    2326     //say 'p_extension='p_extension' p_mode_name='p_mode_name;
    2327 
    2328 
    2329     /* prepare style changes (C) */
     2325    say 'k_style_emacs_var: 'sVar'='sVal;
     2326
     2327    /*
     2328     * Unpack the mode style parameters.
     2329    */
    23302330    _str sStyle = name_info(_edit_window().p_index);
    2331     typeless iIndentAmount, fExpansion, iMinAbbrivation, fIndentAfterOpenParen, iBeginEndStyle, fIndent1stLevel, iMainStyle, iSwitchStyle, sRest;
    2332     parse sStyle with iIndentAmount fExpansion iMinAbbrivation fIndentAfterOpenParen iBeginEndStyle fIndent1stLevel iMainStyle iSwitchStyle sRest;
    2333 
    2334     /* process the variable. */
     2331    _str sStyleName = p_mode_name;
     2332    typeless iIndentAmount, fExpansion, iMinAbbrivation, fIndentAfterOpenParen, iBeginEndStyle, fIndent1stLevel, iMainStyle, iSwitchStyle,
     2333             sRest, sRes0, sRes1;
     2334    if (sStyleName == 'Slick-C')
     2335    {
     2336         parse sStyle with iMinAbbrivation sRes0 iBeginEndStyle fIndent1stLevel sRes1 iSwitchStyle sRest;
     2337         iIndentAmount = p_SyntaxIndent;
     2338    }
     2339    else /* C */
     2340         parse sStyle with iIndentAmount fExpansion iMinAbbrivation fIndentAfterOpenParen iBeginEndStyle fIndent1stLevel iMainStyle iSwitchStyle sRest;
     2341
     2342
     2343    /*
     2344     * Process the variable.
     2345     */
    23352346    switch (sVar)
    23362347    {
     
    24152426            break;
    24162427
     2428        case 'c-label-offset':
     2429        {
     2430            int i = k_style_emacs_var_integer(sVal);
     2431            if (i >= -16 && i <= 16)
     2432            {
     2433                if (i == -p_SyntaxIndent)
     2434                    iSwitchStyle = 0;
     2435                else
     2436                    iSwitchStyle = 1;
     2437            }
     2438            break;
     2439        }
     2440
     2441
    24172442        case 'indent-tabs-mode':
    24182443            p_indent_with_tabs = sVal == 't';
     
    24542479    }
    24552480
    2456     /* change the style? (C only) */
    2457     if (p_mode_name == 'C')
    2458     {
    2459         _str sNewStyle = iIndentAmount' 'fExpansion' 'iMinAbbrivation' 'fIndentAfterOpenParen' 'iBeginEndStyle' 'fIndent1stLevel' 'iMainStyle' 'iSwitchStyle' 'sRest;
    2460         if (sNewStyle != sStyle)
    2461         {
    2462             //say '   sStyle='sStyle;
    2463             //say 'sNewStyle='sNewStyle;
    2464             set_name_info(_edit_window().p_index, sNewStyle);
    2465         }
     2481    /*
     2482     * Update the style?
     2483     */
     2484    _str sNewStyle = "";
     2485    if (sStyleName == 'Slick-C')
     2486        sNewStyle = iMinAbbrivation' 'sRes0' 'iBeginEndStyle' 'fIndent1stLevel' 'sRes1' 'iSwitchStyle' 'sRest;
     2487    else
     2488        sNewStyle = iIndentAmount' 'fExpansion' 'iMinAbbrivation' 'fIndentAfterOpenParen' 'iBeginEndStyle' 'fIndent1stLevel' 'iMainStyle' 'iSwitchStyle' 'sRest;
     2489    if (   sNewStyle != ""
     2490        && sNewStyle != sStyle
     2491        && sStyleName == p_mode_name)
     2492    {
     2493        //say '   sStyle='sStyle' p_mode_name='p_mode_name;
     2494        //say 'sNewStyle='sNewStyle;
     2495        set_name_info(_edit_window().p_index, sNewStyle);
    24662496    }
    24672497
Note: See TracChangeset for help on using the changeset viewer.