Bug 400719

Summary: customized syntax highlighting XML file has no effect any more
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: Mathias <mathias>
Component: frameworkAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph
Priority: NOR    
Version First Reported In: 5.50.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Mathias 2018-11-05 22:41:19 UTC
SUMMARY
My customized syntax highlighting file latex.xml has no effect on the editor's output anymore, not in kate, kile nor kwrite. I had made two changes to the standard latex.xml which were working until now. Since last upgrade, I assume it has been the syntax-highlighting-50.0 package from frameworks, this modification ofthe syntax highlighting xml file has no effect anymore.

STEPS TO REPRODUCE
1. Put customized latex syntax highlighting xml file into ~/.local/share/org.kde.syntax-highlighting/syntax/
2. Open any tex file with editor (kate/kile).

OBSERVED RESULT
See an editor window with standard latex syntax highlighting.

EXPECTED RESULT
See an editor window with latex syntax highlighting as defined in the customized file.

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: KF/plasma-5.50, kde-plasma/plasma-meta-5.13.5
KDE Frameworks Version: 5.50.0
Qt Version: 5.11.1

ADDITIONAL INFORMATION
The purpose of the changes to latex.xml was to show also the bracketed option content of \footcite macros and the content of \footnotes in a different color than normal text. The way to achieve this was to apply the "FancyLabel" context instead of "Label" also to \footcite macros (as it was for /footcites macros) and to define footnote contents als "Option Text" instead of normal text. 
See diff between custom latex.xml and standard latex.xml
@13c13
<         <RegExpr String="\\(cite|citet|citep|nocite|Cite|parencite|Parencite|footcite|Footcite|textcite|Textcite|supercite|autocite|Autocite|citeauthor|Citeauthor|citetitle|citeyear|citeurl|nocite|fullcite|footfullcite)(?=[^a-zA-Z])" attribute="Structure" context="FancyLabel"/>
---
>         <RegExpr String="\\(cite|citet|citep|nocite|Cite|parencite|Parencite|footcite|Footcite|textcite|Textcite|supercite|autocite|Autocite|citeauthor|Citeauthor|citetitle|citeyear|citeurl|nocite|fullcite|footfullcite)(?=[^a-zA-Z])" attribute="Structure" context="Label"/>

@84c84
<       <context name="FootnotingInside" attribute="Option Text" lineEndContext="#stay">
---
>       <context name="FootnotingInside" attribute="Normal Text" lineEndContext="#stay">
Comment 1 Mathias 2018-11-05 22:42:57 UTC
There seems to be an older related bug for kile:
https://bugs.kde.org/show_bug.cgi?id=384123
Comment 2 Dominik Haumann 2018-11-06 10:10:31 UTC
What happens if you also increase the version="" number? This is required since if the version is <= the one used by Kate, then your file will be ignored.
Comment 3 Mathias 2018-11-06 17:28:29 UTC
(In reply to Dominik Haumann from comment #2)
> What happens if you also increase the version="" number? This is required
> since if the version is <= the one used by Kate, then your file will be
> ignored.

Yes, that helped. Thank you very much! 

I just guessed a big enough number. 11 did it, 7 not. This is not very well documented, is it? I do not even understand what exactly this version number is and where "the one used by Kate" can be found - and how it is calculated.

Documentation issue then? The official documentation (https://docs.kde.org/trunk5/en/applications/katepart/highlight.html) remains a bit vague on the topic.

Close?
Comment 4 Christoph Cullmann 2019-08-24 16:02:01 UTC
Given it works with a recent enough version, we can close this.
The version must be higher than for the shipped file (as simple integer >).
But yes, the shipped file version is unfortunately not obvious.