jed-users mailing list

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

C mode parameter offset


Hi.

I am sending the patch for the C_Param_Offset_Max feature for
cmode.sl. This time there is also some documentation.

Marko
--- /cygdrive/s/jed/jed-B0.99-17.95/lib/cmode.sl	2005-04-18 19:02:30.000000000 +0200
+++ /cygdrive/s/localcvs/fljed/jed/lib/cmode.sl	2005-10-04 10:59:24.968750000 +0200
@@ -45,6 +45,22 @@
 %!%-
 custom_variable ("C_Class_Offset", 3);
 
+%!%+
+%\variable{C_Param_Offset_Max}
+%\synopsis{Control indentation of continued parameter list}
+%\usage{Integer C_Param_Offset_Max = 6}
+%\description
+% This variable may be changed to adjust the indentation of parameters
+% in a funcion call that extends over multiple lines.
+% 
+% If the value is less than 0, the feature is off, otherwise
+% it holds the max number of spaces to indent the parameters on
+% the continuation line(s).
+%\seealso{c_mode}
+%\seealso{C_BRA_NEWLINE, C_BRACE, C_INDENT}
+%!%-
+custom_variable ("C_Param_Offset_Max", -1);
+
 define cmode_is_slang_mode ()
 {
    variable is_slang;
@@ -675,6 +691,9 @@
      {
       case 1:
 	extra_indent = 0;	       %  match found
+        if (C_Param_Offset_Max >= 0)
+           if (col - match_indent > C_Param_Offset_Max)
+              extra_indent = match_indent + C_Param_Offset_Max - col;
      }
      {
       case -2:			       %  inside comment

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