Re: [code] [textadept] Arbitrary shell command

From: Robert <rob.g.att.web.de>
Date: Mon, 25 Jun 2012 22:17:18 +0200

On Mon, Jun 25, 2012 at 9:42 PM, Bill Meahan <wmeahan94.att.gmail.com> wrote:
> How so I run an arbitrary shell command and display the results in a new
> view?
>
> What I want to do is run "dict" while passing it values for "word"
> "dictionary" and "strategy" and display the resulting definition(s) and
> thesaurus entries (if any) in a new view, preferable resulting from
> splitting the current window. This rather emulates the behavior of "dict-em"
> in Emacs.
>
> This is neither a "compile" or "run" (of the "just-compiled file") nor is it
> a "filter through" action.
>

_M.textadept.run.execute('dict word')
pasted in the command entry should get you started I think.
You might wrap this in a function with more options (grab word
under cursor) and assign this to a key short cut.
highlight_word in editing.lua has example code for getting the word under the
caret.

> I imagine it's something obvious but I'm new to both Lua and Textadept and
> the docs aren't quite clear.

Hope this helped a bit,
Robert

>
> Thanks!
>
> --
> Bill Meahan, Westland, Michigan USA
>
> “Writing is a combination of intangible
>  creative fantasy and appallingly
>  hard work.”
>
>          —Anthony Powell
>
>
> This message is digitally signed with an X.509 certificate
> to prove it is from me and has not been altered since it was sent.
>

-- 
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 25 Jun 2012 - 16:17:18 EDT

This archive was generated by hypermail 2.2.0 : Tue 26 Jun 2012 - 06:42:33 EDT