home .. forth .. colorforth mail list archive ..

[ColorForth] Editing ColorForth


David Govoni wrote:

> 3) Thirdly the editor would come later.
>
> At first I'd write two programs. The initial coloured forth and a program
> that would translate text based source files into pre-processed forth code
> to be run by the coloured forth.
>
> My initial editor wouldn't be part of the system. It would be an external
> program. Since I'm going to run on an existing system (Linux or Windows or
> both) I want to use the tools I already know intimately. Editors, version
> control systems, etc... this means I'd start with text based source code.

There is a simple way to make Emacs into a ColorForth editor. First,
GNU Emacs has "glyphs", that are almost undocumented, but that I've
been using for years: you can tell Emacs that some characters in a
font are to be displayed as a certain other character (a dot, say) in
a certain colour; with just

  ;; glyphs.el is <http://angg.twu.net/eev/glyphs.el>;
  ;; see also     <http://angg.twu.net/eev/glyphs.el.html>.
  (load-library "~/eev/glyphs.el")
  (glyphs-set-face standard-display-table
   1 ?. 'eev-blue
   2 ?. 'eev-green
   4 ?. 'eev-red
   6 ?. 'eev-yellow-on-red)
  (insert "\001\002\004\006")

you will insert a blue dot (a ^A), a green dot (a ^B), a red dot (a
^D) and yellow dot on red background (a ^F) in your text; Note that
you can insert those characters by hand by typing ^Q^A, ^Q^B, etc.
With a bit of imagination that's an editor for ColorForth programs,
with a very primitive display engine. There are ways to make the
colours of those dots contaminate the text that comes next, but I have
never used that and can't say how easy it is. Links below, anyway.

  http://angg.twu.net/info2www.cgi?(elisp)Syntax+Tables
  http://angg.twu.net/info2www.cgi?(emacs-e20)Font+Lock

Cheers,
  Eduardo Ochs
  http://angg.twu.net/
  http://angg.twu.net/miniforth/TECHREP
  http://angg.twu.net/eev/README.html
  http://angg.twu.net/eev-manifesto.html
  http://www.churchofeuthanasia.org/
  edrx@xxxxxxxxxx

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

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com