Re: cmcSmartTab command
Brought to you by:
set
From: Salvador E. T. <sal...@in...> - 2005-03-03 20:09:08
|
Arnold Wiegert wrote: > Salvador Eduardo Tropea wrote: > >> Arnold Wiegert wrote: > > >>> When I use the function cmsSmartTab in my macros file with the >>> latest snapshot compiled under MSVC6, I get an error from the lisp >>> interpreter: >>> Type of error: syntax >>> command expected >>> Code: ...(cmcSmartTab<*>)^W ... >>> END of SLP >> >> >> >> :-) That's because cmcSmartTab is an editor command, not sLisp. You >> have to send it to the editor using SendCommands as you are doing >> with the others. > > > :-( well, that explains why the program didn't do what I expected, but > it doesn't explain why I didn't catch that one - must have been a bad > day. ;-) > > After fixing the 'problem, and calling cmcSmartTab, it only seems to > insert a single space. > > In working more with it I've noticed a couple other things - really > just nit picking details, though. The only reason I am mentioning them > is in case they do have any significance in relation to what else is > happening. > > I'm working with an empty test.c file and after I type a solitary '{' > to test my macro expansion, I get an error message in the status line > saying: "No match found" - probably from the brace matching code. > > The other bit, after the macro expansion has run, it looks like a > block of text is marked, although when I type any character, the > 'mark' simply reverts back to normal and no text is deleted or replaced. > > More specifically, I type a lone '{' at the top of the file for > testing the macro expansion, press my 'expand' key and expect to get > { > _ > } > > Where the '_' is my expected cursor position. What I do get is only > one space on the line with the underscore, with the space and the > upper '{' highlighted. > > If this doesn't make any sense or is not related to the problem, just > ignore it. :-) > > Otherwise, I'm happy to explain or answer any questions that may arise. Try doing what you wrote in sLisp but manually. I tried it: (progn (InsertText "{}") (SendCommands cmcCharLeft cmcNewLine cmcLineEnd cmcLineUp cmcNewLine cmcSmartTab)) And I got the same as I get when I do it manually. To make it more clear: try asking for real tabs and set the tab size to 8, enable the option to paint tabs and then execute the macro. The only crazy thing that I'm getting is a small error in the code that makes the painting of the matched pair. When using the macro it wrongly left painted the first match and it isn't restored, I guess that's the "mark". This should be fixed. 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 |