Re: [Fwd: Re: inserting spaces for a tab from sLisp]
Brought to you by:
set
From: Salvador E. T. <sal...@in...> - 2005-02-21 19:06:31
|
Thiago F.G. Albuquerque wrote: > On Sat, 12 Feb 2005, Arnold Wiegert wrote: > >> Thiago F.G. Albuquerque wrote: >> >>> On Thu, 10 Feb 2005, Arnold Wiegert wrote: >>> >>>> Hello again, >>>> >>>> I've just tried to work some more on my lisp macros - macros.slp - >>>> as a replacement for pseudo macros and I'm trying to use the >>>> InsertText function to insert spaces using a "\t" string. >>> >>> >>> >>> (InsertText "\t") inserts a real tab. >>> >>>> It works, but I was hoping it would take a hint from the editor >>>> setup which calls for using spaces in place of tabs to keep things >>>> lined up. >>>> >>>> Is there (another) way to do this and get spaces - the number of >>>> spaces set in the Tool&Ops->Options->GlobalEdition->TabSize field? >>> >>> >>> >>> AFAIK, no. >>> >>> One possible solution to this would be to create a new sLisp >>> command, e.g. (GetTabSize). But currenlty, there is no such thing. >>> >> Since it appears that lisp functions such as cmcNewLine use smart >> indenting, I expected/hoped that the other 'features' such as tab/space >> replacement etc. should also be taken into account. > > > I agree with you. 'cmcNewLine' is the command assigned to <enter>, but > there is no similar command for <tab> > I'm back from my vacations and now I'm slowly reading the old mails ... Ok, I added "cmcSmartTab" and assigned it to Tab (important!!! people using custom keybord bindings will need to add this). Then I moved the code inside TCEditor::InsertCharInLine to a new function TCEditor::SmartTab(). So now if the editor gets a tab from the keyboard (not translated to a command) will insert an ASCII 9, but the default is to translate tab into cmcSmartTab. This command implements the complex behavior. Please report any crazy behavior generated by this change. Regards, SET -- Salvador Eduardo Tropea (SET). (Electronics Engineer) Visit my home page: http://welcome.to/SetSoft or http://www.geocities.com/SiliconValley/Vista/6552/ Alternative e-mail: se...@co... se...@ie... Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013 |