Re: [code] [textadept] ui.dialogs

From: Richard Philips <richard.philips.att.gmail.com>
Date: Wed, 15 Jan 2014 15:49:27 +0100

Hello Robert,

Thank you for thinking about this!

First of all, I cannot emphasize enough that I solved my concrete problem
completely to my satisfaction. But, when working on it, I thought it
could be better
and - more importantly - it could be done in such a way that other
people could benefit from it.

Secondly, with regard to your suggestions, Textredux is, I believe, for
use in a text based environment.
I prefer the GUI. Separate buffers seem cumbersome for what I try to
accomplish.

Finally, I try to come up with a good example of what I try to do
(perhaps in a later post I will explain how I solved it:
it was quite an adventure and can easily lead to other things :-)

Ok, here an example (in story format :-)

I'm writing an article for a scientific journal. Of course, a
bibliography is an important part.
Let us say that I will mention the article of Donald Knuth on Literate
Programming.

Normally, in Textadept I would use a snippet with placeholders:

- the name of the author
- title of the article
- the journal
- year of publication
- volume, issue
- doi

The excellent snippet facility would do the formatting for me.

But ... here is the catch.

Depending on the journal I would have to use a different citing style:

As an example I give 'Nature' style and 'IEEE'.

Nature:
1.Knuth, D. E. Literate programming. The Computer Journal 27, 97–111 (1984).

IEEE:
[1]D. E. Knuth, “Literate programming,” The Computer Journal, vol. 27,
no. 2, pp. 97–111, 1984.

These styles work with the same data but are different.

There are literally tens of these styles, often with minor variations.
It would be very tedious to define snippets for each of these styles.
(Moreover, if some placeholders where empty, some of the punctuation
would have to disappear)

Instead of snippets I should use a template system. A template works -
just like snippets - with a frame and placeholders. But unlike snippets,
an advanced template system can modify its frame according to the values
of the placeholders.

So, I have to ask for the values of the placeholders. The most natural -
IMHO - way to do this is extending the one-line ui.dialogs.inputbox to
multiple lines.

Robert, I hope I make it clear what i'm trying to accomplish. Do not
hesitate to ask me for more info.

Richard

On 01/15/2014 11:10 AM, Robert Gieseke wrote:
> Hi Richard,
>
> Am 1/15/14, 4:10 AM, schrieb Mitchell:
>>> The most basic way to extend Lua is by invoking a Lua function with a
>>> number of arguments.
>>> Often these arguments are strings (or numbers or booleans).
>>> Some of these arguments can be specified by the context, some has to
>>> be asked to the user of textadept.
>
> I don't know exactly what you are trying to do, but to give you some
> ideas, maybe you could
> - use Textredux to build a dialog
> - inline your functions (possibly even using snippets or
> auto-completion) and evaluate them with a shortcut
> - use a separate buffer (as many lines as you want) and/or a special
> key mode
>
> Cheers,
> Robert
>

-- 
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 Wed 15 Jan 2014 - 09:49:27 EST

This archive was generated by hypermail 2.2.0 : Thu 16 Jan 2014 - 06:26:35 EST