UltraEdit as a programmers editor - HPW

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
SHX
Posts: 37
Joined: Fri Feb 16, 2007 11:06 pm

UltraEdit as a programmers editor - HPW

Post by SHX »

HPW,

I saw that you recomended ultraedit as a good editor for NewLisp.

Does it have a facility where the Newlisp code can be run directly in the editor?

Thanks

Steven

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Steven,

not sure what you are looking for.

You can highlight a newLISP-expression in UltraEdit and use a tool-macro to evaluate it in newLISP via direct execution mode.
The return value will be shown in a new tab in ultraedit.

The cmdline in tool/configuration:

C:\....\newlisp\newlisp.exe -e %sel%

Beside this you can also config a tool which starts newLISP with the current lisp-file. %F would be the placeholder for the complete filename.
There are many other option. See help-file.
Hans-Peter

SHX
Posts: 37
Joined: Fri Feb 16, 2007 11:06 pm

Post by SHX »

Thanks HPW this is exactly what I was looking for.

I have a couple of followup questions.

You can highlight a newLISP-expression in UltraEdit and use a tool-macro to evaluate it in newLISP via direct execution mode.
The return value will be shown in a new tab in ultraedit.

The cmdline in tool/configuration:

C:\....\newlisp\newlisp.exe -e %sel%
When the newLisp command has quotes

Code: Select all

(directory "c:/" )
it does not work I think because the quotes confuse it so how do you pass a commmand with quotes

Also, I am having trouble passing a file name via the command line. I am in a command window in the newLisp executable directory and I can not get it to execute the newlsip file.

Is this the syntax
newlisp "c:/z/test2.lsp"
Should the slashes be back slashes or front ?

Will I see any output in the command window?

Thanks for your help

Steven

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

When the newLisp command has quotes Code:
(directory "c:/" )
it does not work I think because the quotes confuse it so how do you pass a commmand with quotes
More a problem on the ultraedit side.
Try:

(directory {c:/})

The curly braces also act as a text delimiter.
Also, I am having trouble passing a file name via the command line. I am in a command window in the newLisp executable directory and I can not get it to execute the newlsip file.

Is this the syntax Quote:
newlisp "c:/z/test2.lsp"

Should the slashes be back slashes or front ?
Try:

newlisp c:/z/test2.lsp
Will I see any output in the command window?
Yes, when you use write-line etc.
See newLISP help for more info about console-apps.

Try a file with:

(write-line "hello there")
(exit)

Code: Select all

C:\Programme\newlisp>newlisp test2.lsp
hello there

C:\Programme\newlisp>newlisp "test2.lsp"
hello there

C:\Programme\newlisp>newlisp "c:\Programme\newlisp\test2.lsp"
hello there

C:\Programme\newlisp>newlisp "c:/Programme/newlisp/test2.lsp"
hello there

C:\
Hans-Peter

SHX
Posts: 37
Joined: Fri Feb 16, 2007 11:06 pm

Post by SHX »

HPW, Thanks again for your help.

I see that the reason that the -e switch is not working does not have to do with the quote but rather even if there is a space before the final parentheses it does not work (directory) works (directory ) does not.

Steven

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I am not familiar with UltraEdit but (directory) or (directory ) should not matter. This looks like UltraEdit is breaking up the string at the space before passing to newlisp.

I would also explore the possibility to use escaped quotes, i.e:

Code: Select all

newlisp -e "(directory \"c:/\")"
this way you can tell UltraEdit that (diectory "c:/") is one thing regardless of quotes and spaces, but you still can use quotes to to delimit the entire piece of newLISP source. Another possibility might be this (the curly {} braces are a newLISP text delimiter):

Code: Select all

newlisp -e "(directory {c:/})"
not sure what single quotes do in Windows, but on UNIX you also would try:

Code: Select all

newlisp -e '(directory "c:/")'
Lutz

SHX
Posts: 37
Joined: Fri Feb 16, 2007 11:06 pm

Post by SHX »

Thanks Lutz,
Here is the error.
missing parenthesis : "...(directory \024\234\""
This is the exact error that I get if I just code (directory without the final parenthesis.

I tried your suggestions but they did not work. It gives the error because of the space.

It seems that what you say must be occuring that somehow the space is making it cut off or it is being translated to a different character.

I am new to newLisp and Ultraedit am I am looking for a good editor to use in Windows with newLisp.

I would really appreciate hearing from others on this.

Steven

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

You could use the '!' feature in the newLISP command shell.

When you start newLISP in a Windows command shell you could do:

Code: Select all

>!ultraedit myprog.lsp
In the newLISP command shell the '!' immedeately after the '>' prompt and followed immedeately with a command will work like in a shell/command window. Then after editing you just save/quit from the editor and are back in the newLISP comand line and then do:

Code: Select all

>(load "myprog.lsp")
Cursor-up in the newLISP shell will give you the previous commands, so this feature will let you switch between the newLISP comandline and your editor quickly. This works sepcially well with vi/vim or any edior which loads/quits fast.

Lutz

Ps: note that I have only tried this on UNIX or in CYGWIN or MINGW-MSYS on Windows, but I am pretty sure it also works in a Win32 cmd.exe shell.

SHX
Posts: 37
Joined: Fri Feb 16, 2007 11:06 pm

Post by SHX »

Lutz,

Thanks for your help and most of all thanks for newLisp.

Steven

Locked