% Here are syntax highlighting patterns for Kate and other KDE editors.
% They allow for a nice look in Konqueror, etc.

% If a syntax highlighting description is found for the first time
% some information is copied to
% .kde/share/config/katesyntaxhighlightingrc
% It is not updated later though.

% You may copy or link the syntax files to
%    /opt/kde3/share/apps/katepart/syntax
source("m3quake.xml")
source("modula3.xml")

if not defined( "KDESHARE" )
  KDESHARE = "/opt/kde3/share"
  % FIXME: this should be probed for
end

if not stale( KDESHARE, KDESHARE )

>> ".M3SHIP" in
  foreach file in ["m3quake.xml", "modula3.xml"]
    write("install_file(\".." & SL & "src" & SL & file & "\", KDESHARE & SL & \"apps/katepart/syntax\", \"0644\")\n")
  end
end

% Here are some Mimetypes that allow Konqueror
% to detect Modula-3 related files.

% they should go to
%    /opt/kde3/share/apps/katepart/syntax
% or
%    .kde/share/mimelnk/text/
source("x-m3quake.desktop")
source("x-modula3.desktop")

>> ".M3SHIP" in
  foreach file in ["x-modula3.desktop", "x-m3quake.desktop"]
    write("install_file(\".." & SL & "src" & SL & file & "\", KDESHARE & SL & \"mimelnk/text\", \"0644\")\n")
  end
end

else
  write( "KDESHARE not found; please define it!", CR )
end
