gedit/gtksourceview trouble making new language-spec
- From: Ed Greenberg <edg greenberg org>
- To: gnome-devtools gnome org
- Subject: gedit/gtksourceview trouble making new language-spec
- Date: Thu, 30 Dec 2010 19:34:54 -0600
Hi Folks, Trying to make a new language definition for gedit
(gtksourceview), I seem to be stuck.
I'd like to highlight a c-like language called "Asterisk Extension
Language."
I started by making a copy of the language-specs/c.lang file in my
~/.local/share/gtksourceview-2.0/language-specs directory, called ael.lang.
<language id="ael" _name="ael" version="0.1" _section="Sources">
<metadata>
<property name="mimetypes">text/x-ael</property>
<property name="globs">*.ael</property>
<property name="line-comment-start">//</property>
<property name="block-comment-start">/*</property>
<property name="block-comment-end">*/</property>
</metadata>
----snip---
I created a mime-type definition for ael files called text-x-ael.xml in
~/.local/share/mime/packages, containing this:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/x-ael">
<sub-class-of type="text/plain"/>
<comment>AEL Source Code</comment>
<glob pattern="*.ael"/>
</mime-type>
</mime-info>
I ran update-mime-types ~/.local/share/mime
Stracing the gedit I find that I'm successfully opening both the
ael.lang, and the text/ael-x-ael.xml:
$ grep ael strace.txt
open("/home/edg/.local/share/gtksourceview-2.0/language-specs/ael.lang",
O_RDONLY) = 18
open("/home/edg/.local/share/mime/text/x-ael.xml", O_RDONLY|O_LARGEFILE)
= 26
$
Needless to say, I don't get any highlighting when I run gedit, or I
wouldn't be writing this message.
System is Ubuntu Lucid.
Given that I have both of these files being opened by gedit, I wonder
what I might have done wrong. Any assistance will certainly be appreciated.
Best,
Ed Greenberg
Austin, Texas
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]