beaver-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Beaver-devel] Better MIME Type Patch


From: Eoin Coffey
Subject: [Beaver-devel] Better MIME Type Patch
Date: Sat, 08 Nov 2003 13:45:59 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031014 Thunderbird/0.3

Hello,
    My name is Eoin Coffey and I've been happily using beaver for a few
months now, but one thing that as bugged me of late is that it defaults
every source file to C highlighting.  I went and looked at the code and
noticed that it was fork execing 'file'.  The catch is that (on my
system anyways) file -i return 'text/x-c' for everything.  So, I wrote
the enclosed patch.  Basically, I rewrote determine_mime_type in
tools.c, added a new function to assist me, and a static array of string
of file extension -> mime type pairs.  The patch is against
beaver-0.3.1.  Everything works fine (and faster since there is no
fork-exec), the only thing I notice is that GtkLanguageSource issues a
warning regarding compiling a regex when I open up a Java file, but even
then it all seems to work just fine.  I don't want to sound like a
jackass, but you apply the patch using 'patch -p1 <path-to-patch>' from
the beaver root dir. So, I hope the patch is useful, and please tell me
what you think.   Have a good one.

-Eoin

Attachment: beaver-0.3.1-mime-type.patch.bz2
Description: BZip2 compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]