This is in line with the current hints for better readability:
* one import per line;
* order the imports alphabetically to be easier to search;
Take the chance to remove unused imports.
See here:
https://www.mail-archive.com/search?l=mid&q=a7960223ee91696e916b281d1d9fc55df10a9480.camel%40gmail.com
Description from José pasted below:
Functions `length_in_bp` and `revert_flex_inset` have an error in a
(almost) never used path. The reason why this was never triggered is
because this is part of the code where we try all the best efforts
to recover from an ill-formed LyX file.
The problem is that the functions call the `document` variable to
issue an warning if the file does not follow the usual structure.
The simple fix is to add that variable (as the first for the
functions) and to add them at all the places where the functions are
called.
For reference this code was introduced by Georg (Baum) more than 8
years ago and it was never reported. So the issue is not urgent in
any meaningful way. :-)
In `lyx2lyx/lyx_2_0.py`, in the function `revert_nameref`, there is
a call to the document variable. The same as all the above.
In `lyx2lyx/lyx_2_4.py`, in the `class fontmapping`. Similar to the
above but now for error.
Amends 7bb30286.
Tested cases are now handled fine.
(There are still many cases where the language support emulation
is too complex for lyx2lyx and manual fixes are required after
lyx2lyx conversion.)
If get_containing_layout() finds a layout without name,
it will return an empty string as layoutname.
Calling functions can thus differentiate between missing
\begin_layout and missing layoutname and give a more specific
response or warning.
Don't insert empty line when translating QuoteInsets to literal
quotes.
Fix regexp pattern in re/convert_dashligatures.
Adjust logic in re/convert_dash(ligatur)es.
* use unicode.transform() instead of loop over replacements
* telling variable names
* remove trailing whitespace
* documentation update
* don't set use_ligature_dashes if both dash types are found
* remove spurious warning, normalize indentation, and use
Python idioms in revert_baselineskip()
Fix cases where lyx2lyx adds changes with every round cycle
uncovered by recent ctest change.
Add optional `delete` argument to parser_tools.get*value():
If True, delete the matching line.
More efficient "allowbreak" con/reversion.
New lyx2lyx parser tools find_complete_lines() (replaces find_slice),
del_complete_lines(), and find_across_lines(). Default value 0
for start argument in utility functions.
Rework the implementation of dash-conversion.
Fix failure of revert_dashes() found by lyx2lyx ctests
using an efficient function to find a given sequence of lines
in a list of lines.
Some optimizations using Python idioms instead of C-like code.
Code is by default rendered as typewriter and should be treated
similar:
In text marked up as code, -- or --- is typically part of a
command (e.g. "lyx --help" or "x--") and not a transliteration
for en dash, see #10961.
This is already handled so for text in typewriter font
(see Text.cpp:500).
Update the listings inset to optionally use the minted package
(instead of the listings one) for typesetting code listings.
Only one of the two packages can be used in a document, but it
is possible to switch packages without issues if the used options
are the same. If a switch is made and the options differ, one needs
to manually adjust them if they were entered in the advanced options
tab, or apply again the gui settings.
Note that minted requires the -shell-escape option for the latex
backend and the installation of additional software (python pygments).
Do not treat them as non-verbatim in conversion. This keeps math $...$
as math.
There will be problems with characters that are outside the given
encoding, but as long as there is no way to convert them to the
respective LaTeX macros from within lyx2lyx, I don't know how to solve
this.
New special character to mark an optional line break
without inserting a hyphen (ZWSP). See #10585.
Corresponds to the Unicode character U+200B ZERO WIDTH SPACE
This isn't a “space”. It is an invisible character that can be used
to provide line break opportunities.
http://unicode.org/notes/tn27/
While the literal Unicode character can be used in the LyX
file, it is invisible in the GUI.
For visible feedback, the patch adds a new special character "allowbreak".
The small mark is inspired by LibereOffice.
A tooltip is added.