Loading ...
Sorry, an error occurred while loading the content.

[jasspa] Highlighting anomalies -- when deleting tokens

Expand Messages
  • Thomas Hundt
    Ok here s another totally obscure behavior/bug. For a certain class of text files (phone lists, in this case, which have a special format: fields are tagged by
    Message 1 of 2 , Mar 14, 2000
    • 0 Attachment
      Ok here's another totally obscure behavior/bug.

      For a certain class of text files (phone lists, in this case, which have a special format: fields are tagged by identifiers like H= for home number and W= for work number) I add a few highlighting tokens:

      ; mydoc.emf thundt rev 10 12-Mar-00
      define-macro my-fhook-doc
      :
      :
      ;-----
      ; Special settings for *phone.txt files
      ;-----
      !if &isequal "phone.txt" &right $buffer-fname &sub &len $buffer-fname 9 9
      -39 buffer-mode ; wrap mode off
      set-variable $screen-width 120

      ; Special highlighting for phone.txt
      hilight .hilight.txt 0 "[A-Za-z]+=" .scheme.keyword ; E=xxx
      hilight .hilight.txt 0 ";" .scheme.comment
      hilight .hilight.txt 0x002 "^\*=" .scheme.variable ; *=xxx
      ; .variable = grn, .keyword = blu, .header = org, .comment = red

      ml-write "[special settings for *phone.txt loaded]"
      !else
      ; Delete special highlighting for phone.txt
      ; (because we don't want it happening in letter_to_mom.txt)
      -1 hilight .hilight.txt 0 "[A-Za-z]+="
      -1 hilight .hilight.txt 0 ";"
      -1 hilight .hilight.txt 0x002 "^\*="
      !endif
      :
      :
      !emacro

      Now, this basically works as intended. When I edit a file named xyzphone.txt, the tokens "H=" and "W=" and ";" and "*=ABC" are highlighted in pretty colors. Right.

      But, when I then edit a file named foo.txt, and hope these little artifacts go away, I see instead a weird, new form of highlighting: the exact same tokens are discolored or shaded (not colored, but more like the way the current line is brighter than the normal text). For example, semicolons are reverse video. "W=" tokens are the same color as the current line highlight.

      My suspicion is that the deletion isn't actually taking (since ME still, obviously, is finding the tokens) and the colors are mostly being deleted.

      The current workaround is simply to use a different ME after editing phone.txt files.

      N.b. I use the Black on Cream color scheme.


      -Th
    • Jon Green
      OK, must be a problem here. However I would suggest that you have a separate hilighting scheme for your phone book file. i.e. hkphone.emf In your user.emf then
      Message 2 of 2 , Mar 15, 2000
      • 0 Attachment
        OK, must be a problem here. However I would suggest that
        you have a separate hilighting scheme for your phone
        book file.

        i.e. hkphone.emf

        In your user.emf then add a file hook to bring this
        in with a magic string i.e.

        -1 add-file-hook "-[*!]-[ \t]*phone.*-[*!]-" fhook-phone ; -!- phone -!-

        Then in your phone.txt file use the magic string (noting
        that ';' is a comment in your phone hilighting).

        ; -!- phone -!-

        You can then still call the file phone.txt or whatever,
        the magic string overrides the default extension setting.

        If you did this then you would not need to open multiple
        sessions as there would be no conflicts in the different
        scheme requirements. The phone.emf is simply constructed
        by copying the original hook file and adding the
        additional hilight tokens.

        Regards
        Jon.

        Thomas Hundt wrote:
        >
        > Ok here's another totally obscure behavior/bug.
        >
        > For a certain class of text files (phone lists, in this case, which have a special format: fields are tagged by identifiers like H= for home number and W= for work number) I add a few highlighting tokens:
        >
        > ; mydoc.emf thundt rev 10 12-Mar-00
        > define-macro my-fhook-doc
        > :
        > :
        > ;-----
        > ; Special settings for *phone.txt files
        > ;-----
        > !if &isequal "phone.txt" &right $buffer-fname &sub &len $buffer-fname 9 9
        > -39 buffer-mode ; wrap mode off
        > set-variable $screen-width 120
        >
        > ; Special highlighting for phone.txt
        > hilight .hilight.txt 0 "[A-Za-z]+=" .scheme.keyword ; E=xxx
        > hilight .hilight.txt 0 ";" .scheme.comment
        > hilight .hilight.txt 0x002 "^\*=" .scheme.variable ; *=xxx
        > ; .variable = grn, .keyword = blu, .header = org, .comment = red
        >
        > ml-write "[special settings for *phone.txt loaded]"
        > !else
        > ; Delete special highlighting for phone.txt
        > ; (because we don't want it happening in letter_to_mom.txt)
        > -1 hilight .hilight.txt 0 "[A-Za-z]+="
        > -1 hilight .hilight.txt 0 ";"
        > -1 hilight .hilight.txt 0x002 "^\*="
        > !endif
        > :
        > :
        > !emacro
        >
        > Now, this basically works as intended. When I edit a file named xyzphone.txt, the tokens "H=" and "W=" and ";" and "*=ABC" are highlighted in pretty colors. Right.
        >
        > But, when I then edit a file named foo.txt, and hope these little artifacts go away, I see instead a weird, new form of highlighting: the exact same tokens are discolored or shaded (not colored, but more like the way the current line is brighter than the normal text). For example, semicolons are reverse video. "W=" tokens are the same color as the current line highlight.
        >
        > My suspicion is that the deletion isn't actually taking (since ME still, obviously, is finding the tokens) and the colors are mostly being deleted.
        >
        > The current workaround is simply to use a different ME after editing phone.txt files.
        >
        > N.b. I use the Black on Cream color scheme.
        >
        > -Th
        >
        > ------------------------------------------------------------------------
        > __________________________________________________________________________
        >
        > This is an unmoderated list. JASSPA is not responsible for the content of
        > any material posted to this list.
        >
        > ------------------------------------------------------------------------
        > *** Got Questions? Get Answers. Got Answers? Get Paid. ***
        > Sign up at Infomarco.com and you can win $30,000 cash or a trip to China.
        > http://click.egroups.com/1/1251/4/_/6009/_/953066184/
        >
        > -- Talk to your group with your own voice!
        > -- http://www.egroups.com/VoiceChatPage?listName=jasspa&m=1

        --
        ______________________________________________________________________

        Jon Green J.D.Naughton-Green
        Principal Design Engineer

        SAMSUNG Electronics Ltd
        Samsung Electronics Research Institute (Audio / Visual Labs)
        The Communication Centre
        South Street
        Staines Tel: +44 (0)1784 428600 ext 644
        MIDDLESEX Fax: +44 (0)1784 428620
        TW18 4QE Email (work): jnaught@...
        England Email (home): jon@...
        _______________________________________________________________________
      Your message has been successfully submitted and would be delivered to recipients shortly.