Re: [code] Confused about Events

From: DrTebi <drtebi.att.gmail.com>
Date: Mon, 5 Jan 2015 04:04:37 -0800

Thank you for the tip. I will try that when I find some time; for now
I am quite happy with how it works--since the rst mode in Textadept
catches any errors I make anyway, it's pretty fool-proof ☺

Cheers,
DrTebi

On Sat, Jan 3, 2015 at 5:09 AM, Robert Gieseke <rob.g.att.web.de> wrote:
> Hi,
>
> Am 02/01/15 um 22:46 schrieb DrTebi:
>> Thanks for the quick reply.
>>
>> I figured it out now, it works great!
>>
>> One last thing I would like to implement is the `exit_status` that
>> os.execute returns--I cannot figure out how to act upon it. It
>> *should* return 0 when everything went fine, but I always get a
>> boolean value...
>> I think the better solution would be to use io.popen, but that will
>> get a bit more complicated.
>>
>
> Glad to hear that. `io.popen` would be an option, but it's probably
> better to use Textadept's `spawn`[1] functionality:
>
> Replacing os.execute with something like:
> spawn(
> string.format('%s %q %q', sh_cmd, rst_path, html_path),
> nil, nil, nil,
> function (status)
> ui.statusbar_text = 'Exit code: '..status
> end
> )
>
> The last one is the exit callback and would be different from 0 if e.g.
> rst2html couldn't be found.
>
> Cheers,
> Robert
>
> [1] http://foicica.com/textadept/api.html#spawn
> --
> You are subscribed to code.att.foicica.com.
> To change subscription settings, send an e-mail to code+help.att.foicica.com.
> To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
>

-- 
"The bitterness of poor quality remains long after the sweetness of
low price is forgotten."
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 05 Jan 2015 - 07:04:37 EST

This archive was generated by hypermail 2.2.0 : Tue 06 Jan 2015 - 06:34:58 EST