#47 backlight/rangeset patch ported to CVS HEAD

development
closed-accepted
5
2003-01-10
2002-03-13
Andrew Hood
No

I've taken Josef and Tony's backlight and rangeset patch for the 5.1.1distribution and ported it to
5.3.

There are other patches in the original but I have not included them.

This was nowhere near as hard as I thought it would be, but it is not conditional (ie no #ifdefs)
So far I've tried it on Solaris.

Discussion

  • Andrew Hood

    Andrew Hood - 2002-03-13

    backlight/rangeset patch

     
  • Andrew Hood

    Andrew Hood - 2002-03-14

    Logged In: YES
    user_id=36856

    Revised patch. This touches a number of other sources, so the whole project will compile with -Werror
    (except parse.c which, being generated by yacc/bison, is not under our control).

     
  • Andrew Hood

    Andrew Hood - 2002-03-14

    backlight/rangeset patch - version 2

     
  • Thorsten Haude

    Thorsten Haude - 2002-04-09

    Logged In: YES
    user_id=119143

    Two comments:
    - there are some superfluous commas in macro.c (MacroSubrs
    and MacroSubrNames)
    - I think a single README explaining what's going on would
    really help.

     
  • Thorsten Haude

    Thorsten Haude - 2002-04-09

    Logged In: YES
    user_id=119143

    I added
    -DBACKLIGHT_CODE -DRANGESET_CODE \ -DSETREADONLY_AP_CODE -DSHOWMENU_AP_CODE \ -DHIGHLIGHT_INFO_CODE -DCOLOR_PATCH
    to the makefile, but it doesn't compile, I get lots of
    parsing errors, starting in textBuf.h:54.

     
  • Andrew Hood

    Andrew Hood - 2002-04-10

    Logged In: YES
    user_id=36856

    Alexander Kriegisch spotted that one a couple of days ago. It would work if you didn't include
    -DRANGESET_CODE in the Makefile.

    In source/textBuf.h remove the #ifndef RANGESET_CODE/#endif pair around #include "rangeset.h".

    I thought I had removed all the conditionals. Don't know how I missed that one.

     
  • Tom Heathcote

    Tom Heathcote - 2002-05-23

    Logged In: YES
    user_id=523342

    I have built NEdit with this patch on several platforms
    and had no problems. It seems pretty robust and
    portable.

    The platforms are: Linux (RedHat 5.2 and 6.2), SGI-IRIX
    (5.3), IBM-AIX (2), HP-UX (A.09.03 and B.10.20) and
    Solaris (2.6). It all cases it is linked against Motif, so I
    won't see any problems that might arise with Lesstif or
    OpenMotif.

     
  • Tom Heathcote

    Tom Heathcote - 2002-05-23

    Logged In: YES
    user_id=523342

    **********************************************************
    BUGFIX:

    There is a small bug in this patch (and in all previous
    versions of the rangeset/backlight patch too).

    If you have a range that starts at the beginning of the
    file (at character 0), the macro function
    rangeset_includes_pos will incorrectly return false for a
    character in this range.

    To fix this bug, here is a patch to be applied on top of
    the patch-5.3 file (before applying patch-5.3 to the
    NEdit source, of course). Paste the text between the
    lines below into a file, fix.patch in the same directory as
    patch-5.3. Then enter "patch -p0 < fix.patch".

    --------------------------------------------
    *** patch-5.3.old Thu May 23 19:41:24 2002
    --- patch-5.3 Thu May 23 19:41:52 2002
    ***************
    *** 1783,1793 ****
    +
    + /* set up result */
    + RangesetTableAssignMacroVars(tab, p, ind);
    +
    + result->tag = INT_TAG;
    ! + result->val.n = (ind > 0);
    + return True;
    + }
    +
    + /*
    + ** Set the color of a range set's ranges. it is ignored
    if the color cannot be
    --- 1783,1793 ----
    +
    + /* set up result */
    + RangesetTableAssignMacroVars(tab, p, ind);
    +
    + result->tag = INT_TAG;
    ! + result->val.n = (ind >= 0);
    + return True;
    + }
    +
    + /*
    + ** Set the color of a range set's ranges. it is ignored
    if the color cannot be

    --------------------------------------------

    If you prefer to make the fix by hand: first apply the
    rangeset patch, then go into the NEdit source directory
    and edit the file macro.c. Find the definition of the
    function rangesetIncludesPosMS, and go down to the
    end, you need to change the last-but-one line of this
    function from:

    result->val.n = (ind > 0);

    to:
    result->val.n = (ind >= 0);

     
  • Tom Heathcote

    Tom Heathcote - 2002-05-23

    Logged In: YES
    user_id=523342

    NOTE:

    In the previous comment (the bug fix), the two lines in
    the patch section that read "if the color cannot be" have
    been wrapped. This text should be on the end of the
    previous line. You will need to fix this or the patch will
    fail.

     
  • Andrew Hood

    Andrew Hood - 2002-07-27

    Logged In: YES
    user_id=36856

    New version for CVS HEAD after calltips merge.
    No new code beyond fixing rejects and merging previously
    reported bugs.
    Does NOT reorder #includes.

     
  • Andrew Hood

    Andrew Hood - 2002-07-27

    backlight/rangeset patch for CVS after calltips merge

     
  • Andrew Hood

    Andrew Hood - 2002-08-18

    Logged In: YES
    user_id=36856

    New version for CVS HEAD 2002/08/18

     
  • Thorsten Haude

    Thorsten Haude - 2002-08-18

    Logged In: YES
    user_id=119143

    How can this possibly work? rangeset_fn.h uses Pixel, but
    nothing related to X is included.

     
  • Thorsten Haude

    Thorsten Haude - 2002-08-18

    Logged In: YES
    user_id=119143

    I had two trivial rejects, but it was a clean compile after
    I fixed them.
    I don't see colors though. I tried this:
    set_backlight_string("9:red")
    But I don't see tabs colored.
    (Maybe they were not trivial?)

     
  • Andrew Hood

    Andrew Hood - 2002-08-19

    Thorsten's macro diff

     
  • Andrew Hood

    Andrew Hood - 2002-08-19

    Logged In: YES
    user_id=36856

    Added Thorsten's patch to the list of files.
    Only use the patch to update your sources. The separate
    source files should no longer be required, and are left for
    historical reasons.
    Could you send me the rejects? Any of my mail addresses will
    do.
    The latest version was built by extracting a clean copy of
    CVS, making sure my version compiles, and diffing the two.
    There are includes of Xm/Xm.h in a couple of files to
    resolve Pixel.

     
  • Andrew Hood

    Andrew Hood - 2002-08-25
    • summary: backlight/rangeset patch ported to 5.3 --> backlight/rangeset patch ported to CVS HEAD
     
  • Scott Tringali

    Scott Tringali - 2003-01-10

    Logged In: YES
    user_id=11321

    In CVS now.

     
  • Scott Tringali

    Scott Tringali - 2003-01-10
    • labels: --> Build/Install
    • milestone: --> development
    • assigned_to: nobody --> ajhood
    • status: open --> closed-accepted
     

Log in to post a comment.