On 12/08/2012 04:17 AM, Andrew Parsloe wrote:
(1) If an inset name contains a vertical bar, |, the part after the bar is not shown in the Insert > Custom Insets list, but is retained in LyX format. Using the schema, inset definition => Custom Insets list => LyX file format,

InsetLayout Flex:foo|bah => foo => \begin_inset Flex foo|bah

(This works also with quotes around inset names containing spaces.) This is surprisingly useful, but doesn't seem to be documented in the Customization manual. It allows information, which doesn't need to be shown to the user, to be passed in the name of the inset from the module in which it is defined to LyX. I've used this 'to serious purpose' and without ill effect so far, but would like to be sure, given the lack of documentation, that it is not going to snag on some other feature of LyX.

The | character is used in Qt4 to specify menu shortcuts. See e.g. the stdmenus.inc file. So whatever follows it is being interpreted as an attempt to specify a menu shortcut. So I'd not recommend using it this way, but I'm not sure what we should do about it. At least, we should put something into the documentation.

(2) Quotes are needed if a custom inset name has a space. I noticed that if the space is deleted but the quotes retained, not only does the inset disappear from the Custom Insets list (it's replaced by a blank line), but in LyX format it becomes undefined:

InsetLayout "Flex:foobah" =>  => \begin_inset Flex undefined

The natural behaviour seems to me for the quotes to have no effect when there's no space in the name. This feels like a bug.

This is a bug in the layout2layout conversion routine. Quoted names that do not contain spaces were wrongly being detected as unquoted names. I've fixed it. Since this is just in the layout2layout.py script, you can fix the bug in your own installation by applying 24dea042c.

(3) Underscores in inset names:

InsetLayout Flex:foo_bah => foo bah => \begin_inset Flex foo bah

Although the underscore is replaced by a space in the middle & right columns, using quotes around the name again produces invisibility in the Custom Insets list and an undefined inset in LyX file format. Again I can't see any documentation about underscores in the Customization manual.

Same bug.

Richard


Reply via email to