JoePatches

This page documents the patches made in SzSzI to JOE 3.5 (http://joe-editor.sourceforge.net/). The patches were made by Péter Szabó.

Download i386 binary package for Debian Sarge starting from http://www.szszi.hu/~pts/joe/

How to apply the patches and recompile joe

$ wget http://www.szszi.hu/~pts/joe/joe-3.5.tar.gz
$ wget http://www.szszi.hu/~pts/joe/pts-joe-3.5-01-misc.patch
$ wget http://www.szszi.hu/~pts/joe/pts-joe-3.5-02-preprocessor.patch
$ tar xzvf joe-3.5.tar.gz
$ (cd joe-3.5 && patch -p1 <../pts-joe-3.5-01-misc.patch)
$ (cd joe-3.5 && patch -p1 <../pts-joe-3.5-02-preprocessor.patch)
$ (cd joe-3.5 && ./configure)
$ (cd joe-3.5 && make)
$ su -c 'cd joe-3.5 && make install'

misc.patch

Download from http://www.szszi.hu/~pts/joe/pts-joe-3.5-01-misc.patch

This patch fixes a few bugs and quirks, and also adds a few small features. If necessary, we can split this patch to several smaller patches.

Bugfixes:

New or improved features:

Implementation improvements:

preprocessor.patch

Download from http://www.szszi.hu/~pts/joe/pts-joe-3.5-02-preprocessor.patch

This patch adds a preprocessor to the .joerc configuration files. Preprocessing is done separately on one each line read from configuration files. Only lines starting with $ are affected (others are left unchanged). The affected lines are replaced by the string returned by the preprocessor, and the replaced line is parsed by JOE as a regular configuration file line.

The rationale for a preprocessor is to allow JOE's configuration depend on the environment variables. For example, the following configuration lines turns off syntax highlighting for the terminal types xterm and rxvt, and turn it on for all other terminals:

-highlight
$()$(if(iseq(getenv("TERM"),"rxvt"),"--highlight"))
$()$(if(iseq(getenv("TERM"),"xterm"),"--highlight"))

The first line (-highlight) turns on syntax highlighting, and the other two lines conditionally turn it off (with --highlight) if the value of the TERM environment variable is rxvt or xterm, respectively.

Here is a more compact solution:

$(if(or(iseq(getenv("TERM"),"xterm"),iseq(getenv("TERM"),"rxvt")),"-"))-highlight

Both solutions demonstrate that the preprocessor syntax is quite ugly. A nicer syntax would be:

joe.options.highlight=
  ((t=joe.getenv("TERM"))=="xterm" || t=="rxvt") ? false : true

Adding scripting support (e.g. lua) for both the configuration file and runtime macros would be a proper solution to avoid this ugliness. This patch focuses on easy-to-implement and yet powerful-enough configuration file preprocessing.

Definition of the preprocessor syntax:

Definition of the preprocessor expression syntax:

Evaluation of expressions:


Rá hivatkozók: http://www.szszi.hu/kozlemenyek/sajto/2006/10/04/joe/