Bug 214658

Summary: Prolog files highlighted as perl
Product: [Applications] kate Reporter: Vincent Verhoeven <verhoevenv>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: cullmann, jowenn
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Unspecified   
Latest Commit: Version Fixed In:

Description Vincent Verhoeven 2009-11-15 15:22:03 UTC
Version:            (using KDE 4.3.2)
Installed from:    Ubuntu Packages

When opening Prolog files (which share the .pl extension with Perl), the code is by default highlighted as if it were Perl.

Reproduce:
1. Create a file named "test.pl" with content like:
%This is Prolog!
cat(tom).
%And it's really fun when you start adding apostrophes!
mammal(X) :- cat(X).
2. Open file in Kate, syntax highlighting is completely off. User must traverse quite the menu structure to get it to highlight correctly and must do so for every file if she opened a lot of Prolog files.

Expected:
Syntax highlighting defaults to Prolog for Prolog files.
Comment 1 Joseph Wenninger 2009-11-19 13:31:55 UTC
Having the same file extension is bad. Does a mimetype exist for prolog files? Kate used additionally to the file extension the KDE mimetype system for determing what kind of file it is dealing with.

You can increase the priority of the highlighting so that it is favoured in the highlighting configuration.
Editor Component -> Open/Save -> Modes Filetypes -> Sources/Prolog
There you can add the .pl Extension and increase the priority
Comment 2 Vincent Verhoeven 2009-11-21 17:02:35 UTC
It seems KDE recognizes the files as Perl files (application/x-perl), which is also what xdg-mime gives (not sure that is relevant though).

I believe the correct mime type should be "text/x-prolog".

Perhaps I should just start giving my files .prolog extensions. I don't think that's the convention though, I've never encountered it before.

Manually adding the extension seems to fix most problems. Although I probably shouldn't try editing Perl files now. :)
Comment 3 Christoph Cullmann 2010-02-16 18:49:27 UTC
:) Anyway, nothing kate can fix, if the mimetypes don't get fixed.