Martin Vermeer wrote:
On Sat, Oct 06, 2007 at 11:52:37PM +0200, Tommaso Cucinotta wrote:
 Paul A. Rubin ha scritto:
The way I enter an optional argument (when one is allowed) is to open the minibuffer (M-x or View -> Toolbars -> Command buffer) and type the command 'optional-insert'.
 Great ! Exactly what I was needing. Probably my fault for not having
 read throughly the user manual. Anyhow, a Insert->Optional argument,
 or Insert->Layout option menu voice would help users in finding this
 wonderful feature, wouldn't it ?

 What about considering the attached addition to the menu file ?

    T.

Actually the is an entry like this: "Short title". It has
been criticised for being descriptive only of one use case
(short versions of titles going to the toc), so perhaps
you could come up with a more descriptive name (that nevertheless doesn't lead the naive user astray)
Can't give you a new name, but an idea that is much more work
to implement. :-( Still, it'd be a nifty thing to have:

* Any layout (paragraph style or text/char style) implemented
 with a latex command or environment should be able to
 specify several arguments (optional and mandatory ones)
 as well as their types. (generic text, generic number, a length,
 or a set of predefined values.) Perhaps a few more. Numbers
 may have constraints, lengths might be glue lengths.

*  When using such a style, defaults are used for all the options. Just
  like what happens when you insert a minipage. If the user right-clicks
  the entity (paragraph or charstyle) then he gets a dialog where the
  parameters can be set withing the constraints of the type.

This concept would support lots of latex constructs, one could even
consider making the minipage a charstyle. :-)  It'd make the
flexible insets/modules much more powerful.

The hard part is those dialogs, that must be auto-generated
from the information in the layout/module. That is why
I suggest a limited amount of "option types", to make it
possible at all. One could start with the "generic text" only,
because it can stand in for all the others.  (But in doing so,
it allows all sorts of latex errors.)
The autogenerated dialog could have one "line" per
parameter, each line having a label and a edit field,
or a combobox in the case of a predefined set of valid values.


Reply via email to