While trying to fix #6786 (http://www.lyx.org/trac/ticket/6786), I found out
that the naming of Flex insets is very weird.

Most insets use for InsetLayout a simple and predictable naming: Name:type. "Name" is the inset name used in the lyx file (Note, Branch...), and type is a subtype of choice (branch1, greyedout...). The inset layout code is done in such a way that, if the inset lqyout Note:yellow does not exist but Note exists,
it will be used as a fallback.

Now if we look at real names in our layouts, grep tolds us (I removed the
hardcoded ones), we find the list at the end of the message.

So I know I am coming after the battle here, but I wonder what is the need of adding (or not) the Custom: prefix to the inset name. The inset name is going to be shown in the interface, and having this prefix in menus is rather ugly IMO.

But in fact, we can chose _not_ to have it, and everything will work in the same way. The orthodox way of doing it would have been to have something like

InsetLayout Flex:Noun
  LyxType charstyle
 ...

Then this gets written in the lyx file as

\begin_inset Flex Noun
 ...

I think that we should before 2.0 (but my time for doing it is going to be
scarce unfortunately) change our layouts and our LyX format to enforce
these rules. This will IMO make the menus look better and make sure that
everything is coherent. In the future, it will help us to have a single notion
of name and type for insets, which can be used for InsetLayout, but also
for naming inset dialogs and for the LyX file format. This will be helpful
IMO if we ever switch to xml.

The plan would be:

* layout2layout: for all insets layouts which name is not in the hardcoded list (Note, Branch...), including Custom:, CharStyle:, and Element:, remove the existing prefix
  and replace it with Flex:
* lyx2lyx: do the same, but do not add Flex: :)
* change description of flex-insert in LyXAction.cpp. It seems to me that it is completely
  wrong
* check documentation.

Sorry if this message is too long (again!)

JMarc

aa.layout:InsetLayout institutemark
aa.layout:InsetLayout CharStyle:Institute
aa.layout:InsetLayout CharStyle:E-Mail
aa.layout:InsetLayout Email
aastex.layout:InsetLayout altaffilmark
aastex.layout:InsetLayout tablenotemark
achemso.layout:InsetLayout scheme
achemso.layout:InsetLayout chart
achemso.layout:InsetLayout graph
achemso.layout:InsetLayout Bibnote
achemso.layout:InsetLayout Chemistry
acmsiggraph.layout:InsetLayout CRcat
agu_stdclass.inc:InsetLayout Element:Firstname
agu_stdclass.inc:InsetLayout Element:Fname
agu_stdclass.inc:InsetLayout Element:Surname
agu_stdclass.inc:InsetLayout Element:Filename
agu_stdclass.inc:InsetLayout Element:Literal
agu_stdclass.inc:InsetLayout Element:Emph
agu_stdclass.inc:InsetLayout Element:Abbrev
agu_stdclass.inc:InsetLayout Element:Citation-number
agu_stdclass.inc:InsetLayout Element:Volume
agu_stdclass.inc:InsetLayout Element:Day
agu_stdclass.inc:InsetLayout Element:Month
agu_stdclass.inc:InsetLayout Element:Year
agu_stdclass.inc:InsetLayout Element:Issue-number
agu_stdclass.inc:InsetLayout Element:Issue-day
agu_stdclass.inc:InsetLayout Element:Issue-months
agu_stdtitle.inc:InsetLayout Element:ISSN
agu_stdtitle.inc:InsetLayout Element:CODEN
agu_stdtitle.inc:InsetLayout Element:SS-Code
agu_stdtitle.inc:InsetLayout Element:SS-Title
agu_stdtitle.inc:InsetLayout Element:CCC-Code
agu_stdtitle.inc:InsetLayout Element:Code
agu_stdtitle.inc:InsetLayout Element:Dscr
agu_stdtitle.inc:InsetLayout Element:Keyword
agu_stdtitle.inc:InsetLayout Element:Orgdiv
agu_stdtitle.inc:InsetLayout Element:Orgname
agu_stdtitle.inc:InsetLayout Element:Street
agu_stdtitle.inc:InsetLayout Element:City
agu_stdtitle.inc:InsetLayout Element:State
agu_stdtitle.inc:InsetLayout Element:Postcode
agu_stdtitle.inc:InsetLayout Element:Country
beamer.layout:InsetLayout InstituteMark
beamer.layout:InsetLayout CharStyle:Alert
beamer.layout:InsetLayout CharStyle:Structure
beamer.layout:InsetLayout Custom:ArticleMode
beamer.layout:InsetLayout Custom:PresentationMode
braille.module:InsetLayout Braillebox
db_stdcharstyles.inc:InsetLayout Element:Firstname
db_stdcharstyles.inc:InsetLayout Element:Surname
db_stdcharstyles.inc:InsetLayout Element:Literal
db_stdcharstyles.inc:InsetLayout Element:Email
db_stdcharstyles.inc:InsetLayout Element:KeyCombo
db_stdcharstyles.inc:InsetLayout Element:KeyCap
db_stdcharstyles.inc:InsetLayout Element:GuiMenu
db_stdcharstyles.inc:InsetLayout Element:GuiMenuItem
db_stdcharstyles.inc:InsetLayout Element:GuiButton
db_stdcharstyles.inc:InsetLayout Element:MenuChoice
elsarticle.layout:InsetLayout Titlenotemark
elsarticle.layout:InsetLayout Authormark
elsarticle.layout:InsetLayout CorAuthormark
endnotes.module:InsetLayout Custom:Endnote
IEEEtran.layout:InsetLayout IEEE_membership
IEEEtran.layout:InsetLayout Lowercase
initials.module:InsetLayout CharStyle:Initial
linguistics.module:InsetLayout Custom:Glosse
linguistics.module:InsetLayout Custom:Tri-Glosse
linguistics.module:InsetLayout CharStyle:Expression
linguistics.module:InsetLayout CharStyle:Concepts
linguistics.module:InsetLayout CharStyle:Meaning
logicalmkup.module:InsetLayout CharStyle:Noun
logicalmkup.module:InsetLayout CharStyle:Emph
logicalmkup.module:InsetLayout CharStyle:Strong
logicalmkup.module:InsetLayout CharStyle:Code
stdcharstyles.inc:InsetLayout CharStyle
stdcustom.inc:InsetLayout Custom
svglobal3.layout:InsetLayout Email
svglobal3.layout:InsetLayout Keywords
svglobal3.layout:InsetLayout PACS
svglobal3.layout:InsetLayout Subclass
svmult.layout:InsetLayout Inst
sweave.module:InsetLayout "Sweave Options"
sweave.module:InsetLayout "S/R expression"
sweave.module:InsetLayout "Sweave Input File"
tufte-book.layout:InsetLayout Sidenote
tufte-book.layout:InsetLayout Marginnote
tufte-book.layout:InsetLayout NewThought
tufte-book.layout:InsetLayout AllCaps
tufte-book.layout:InsetLayout SmallCaps

Reply via email to