- Subject: Re: Reindent an entire C code in one shot
- From: "John E. Davis" <davis>
- Date: Thu, 21 Nov 2002 12:20:14 -0500
Guenter Milde <milde@xxxxxxxxxxxxxxxxxxxx> wrote:
>On Tue, 19 Nov 2002 11:12:52 -0500 wrote "John E. Davis" <davis@xxxxxxxxxxxxx>:
>> > while (what_line <= End_Line)
>> > {indent_line; down_1;}
>>
>> You probably want to use go_down_1 instead of down_1, since down_1
>> returns a value that you are not not using.
>
>Thank you John, one of my typical errors. (is there a debugging tool that
>could warn me about unused return values?)
No, because slang permits those return values to be used at any time.
Whether desirable or not, some code actually exploits this feature.
About all I can suggest is that if you know that some function should
not leave a value on the stack, then you can wrap the function up such
as:
depth = _stkdepth ();
some_function ();
depth = _stkdepth () - depth;
if (depth)
error ("Problem in some_function");
>I know about the solution to reset the TAB key with the global-mode hook.
>Still I wonder, whether it would be more clean to
I think that the solution is to remove explicit tab key bindings
from the code and rely soleup upon the indent_line_hook functions.
The default binding of the tab key could be to the "indent_line"
functions. Then if the user does not like the smart indentation by
the tab key, the user can simply bind if to, e.g., "self_insert_cmd".
Do you see a problem with this proposed scheme?
Thanks,
--John
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2002 date index]
[2002 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]