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

[jasspa] Futher inserted hilighting modes.

Expand Messages
  • Jon
    Further Detlef s suggestion for insertion hilighting which works very nicely (Thanks - very nice idea). You can make the hilighting modes load
    Message 1 of 1 , Mar 14, 2000
    • 0 Attachment
      Further Detlef's suggestion for insertion hilighting which works
      very nicely (Thanks - very nice idea). You can make the
      hilighting modes load automatically without defining macro
      loaders by loading them through the my-fhook-XXX extensions.

      Ironically I have started to write some very high level
      documentation on using the hilighting, following Dave E's and
      Alex's request for some more information. The text is written in
      the "document; pseudo-code" template, with extensions to provide
      the hilighting. i.e. a text extract is defined as follows:-

      > 3.0 Hilighing by Example
      >
      > This section describes the hilighting techniques by example.
      > The manual page on hilight(2) describe what the raw tokens
      > do, in this section we take examples from the various
      > hilighting schemes and show how they are used.
      >
      > 3.1 Simple token hilighting
      >
      > The simplest form of hilighting is token hilighting where
      > keywords are only present in the text surrounded by white
      > space (i.e. non-alphanumeric characters), so key words such
      > as `if', `then', `else' and `endif' fall into this category
      > i.e.
      >
      > >emf>
      > hilight .hilight.eg 1 "if" .scheme.keyword
      > hilight .hilight.eg 1 "then" .scheme.keyword
      > hilight .hilight.eg 1 "else" .scheme.keyword
      > hilight .hilight.eg 1 "endif" .scheme.keyword
      > >doc>
      >
      > This hilights statements such as:-
      >
      > >eg>
      > if(condition)
      > then
      > do this
      > else
      > do that
      > endif
      > >doc>
      >
      >
      > If the tokens are case insensitive then the hilighting mode
      > is specified as case insensitive in the hilighting scheme
      > i.e.

      The document template to alternate the hilighting is defined as
      follows in file "mydoc.emf":-

      define-macro my-fhook-doc

      ; Allow .eg inserts.

      ; Force the ".eg" scheme to be loaded into the context of the document
      ; scheme. We delimit the .eg scheme with a pair of markers ">eg>" and
      ; ">doc>" at the start of the line.
      ;
      ; Force the hilighting mode to load if not already loaded.
      !if &seq .hilight.eg "ERROR"
      !force execute-file "hkeg"
      !endif
      ; If the hilighting mode is loaded then modify it.
      !if ¬ &seq .hilight.eg "ERROR"
      hilight .hilight.psu 0xc0 "^>eg>" ">eg>" .hilight.eg .scheme.hide
      hilight .hilight.eg 0xc0 "^>doc>" ">doc>" .hilight.psu .scheme.hide
      !endif

      ; Allow .emf inserts

      ; Force the ".emf" scheme to be loaded into the context of the document
      ; scheme. We delimit the .emf scheme with a pair of markers ">emf>" and
      ; ">doc>" at the start of the line.
      ;
      ; Force the hilighting mode to load if not already loaded.
      !if &seq .hilight.emf "ERROR"
      !force execute-file "hkemf"
      !endif
      ; If the hilighting mode is loaded then modify it.
      !if ¬ &seq .hilight.emf "ERROR"
      hilight .hilight.psu 0xc0 "^>emf>" ">emf>" .hilight.emf .scheme.hide
      hilight .hilight.emf 0xc0 "^>doc>" ">doc>" .hilight.psu .scheme.hide
      !endif
      !emacro

      Obviously the alternation tokens may be changed to anything that
      you want and may be applied to any existing template.

      Regards
      Jon.
    Your message has been successfully submitted and would be delivered to recipients shortly.