Re: Midnight Commander mod with Colorer-take5 syntax engine



Hello,

Find attached the patch. In order to build MC you have to run
libtoolize in the MC source tree. I've added the ability to tell
configure where you colorer is installed. You can pass the
colorer directory via the --with-colorer configure option - for
example:

--with-colorer=/home/ptsekov/colorer

This command line option defaults to /usr/local. This patch is
just a proof of concept thing. I am posting it so that you can
test it and then we can discuss it.

Igor, do you mind moving the declarations of the classes found in syntax-colorer.cpp to syntax-colorer.h ? This way we could move all the C functions from syntax-colorer.cpp to syntax-colorer-interface.cpp and make them static and only accessible
thru colorer_interface_t.

On Fri, 23 Jun 2006, Pavel Tsekov wrote:

On Thu, 22 Jun 2006, Oswald Buddenhagen wrote:

On Thu, Jun 22, 2006 at 05:30:38PM +0400, Igor Russkih wrote:
already implemented.
I should look for that switch then :) .
It's a runtime option in editor's settings dialog. You'll find it easily ;)

fwiw, i think this is silly. typical example of over-configurability. if
it has to be runtime-switchable (why?), don't put it in the dialog at
least.


Today I've modified Igor's patch as follows:

1) The part of his patch which depends on libcolorer
is built as shared library (libcolorer_glue). The library
exports a single method which is used to get an array
of function pointers - these are methods from the library
that the editor calls.

2) The part of his patch which doesn't directly depend
on libcolorer remains in the editor source tree (only
C code). It exports a set of functions which the code
in libcolorer_glue needs to query to the editor, again
passed as an array of functions pointers.

3) The editor tries to dynamically load libcolorer_glue.so
and if it fails it fallbacks to the default syntax highlighting
code. Otherwise colorer is used.

These changes allow one to build MC with colorer support but
doesn't require libcolorer to be present on the target system.

I've made also some other changes - mainly related to the autoconf
stuff.

Since I am to tired to diff now I'll post patches tomorrow.



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