jed-users mailing list

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

Re: pre-release version of 0.99-17 available


Hello!

On june 2nd 2003 I posted a patch for cmode.sl, but it didn't get into 0.99-17.
Since it adds a very useful feature, it think it would be good
to include it.

The post from 2003-06-02 with the patch is appended.

Marko Mahnic


-------------------------------------------------------------------------
Here is a patch that enables one to indent function call parameters like
this:

      foothatdoessomething(
            p1,
            p2);

instead of this:

      foothatdoessomething(
                           p1,
                           p2);

To enable the feature, in your .jedrc (jed.rc) add

custom_variable ("C_Param_Offset_Max", N);

where N is the maximum number of characters to indent from previous line.
If N is less than 0, feature is disabled. In the example above, N=6.

Marko

--- cmode.sl.orig     2002-10-20 08:55:30.000000000 +0200
+++ cmode.sl    2003-06-02 12:46:16.000000000 +0200
@@ -19,6 +19,7 @@
 %!%-
 custom_variable ("C_Autoinsert_CPP_Comments", 1);
 custom_variable ("C_Switch_Offset", 0);
+custom_variable ("C_Param_Offset_Max", -1);

 define cmode_is_slang_mode ()
 {
@@ -637,6 +638,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


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