displaying function name

Joachim Lous joachim.lous at nr.no
Mon Aug 30 10:07:44 CEST 2004


discuss-bounces at nedit.org wrote:
> On Mon, 30 Aug 2004 17:07:47 +1000, Michael Smith wrote:
>> #F11
>> #Open the file named at the cursor
>> define open_file_at_cursor
>> {
>>     start=search("^",$cursor,"regex","backward")
>>     end=search(": ",$cursor)
>>     eol=search("$",$cursor,"regex")
>>     filename=get_range(start,end)
>>     detail=get_range(end,eol)
>>     details=split(detail,"\w","regex")
>>     for(item in details)
>>     {
>>       final = final "_" item
>>     }
>>     command="open-mark " filename " \"" final "\""
>>     t_print(command "\n")
>>     shell_command(command,"")
>> }
>> 
> 
> Hi,
> Does this work? I get an error message when I try to use it:
> "Error executing macro: variable not set: final"

It does look like it would fail if "details" is empty, yes.

> Also, how is this different from the File->Open Selected menu item
> (hot key: ^y)? Thanks,

It doesn't require you to select anything, and leaves any existing
selection alone.

-Joachim



More information about the Discuss mailing list