emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enriched-mode and switching major modes.


From: Robert J. Chassell
Subject: Re: enriched-mode and switching major modes.
Date: Tue, 21 Sep 2004 14:43:46 +0000 (UTC)

Previously, when talking about transforming documents, I have focused
on two terms for thinking from an end user's (not a programmer's)
point of view, "deep representation" and "surface expression".

But three terms fit the situation more closely:

    "deep representation"  
    "intermediate expression" 
    "surface expression"

Among other things, the additon enables us to talk about the Lisp
object representation more readily.

Suppose we want to display an enumerated list, such as Kai Grossjohann
provided.  In plain text it looks like this:

    1. First item.  This item has a lot of text to show what happens when
       it is multi-line.

    2. Second item.

    3. Third item.

In Texinfo, the list looks like this:

    @enumerate
    @item First item.  This item has a lot of text to show what happens when
    it is multi-line.

    @item Second item.  

    @item Third item.  
    @end enumerate

The Texinfo source is the "deep representation" which is also the
"encoded document file".

For Info, makeinfo produces this:

  1. First item.  This item has a lot of text to show what happens
     when it is multi-line.

  2. Second item.

  3. Third item.

(In the past, the Info file has been a permanent file rather than a
temporary data structure.  That does not matter for this discussion.)

The Info output is a `surface expression' for one kind of
human/computer interaction but the source for another.  When talking
about it as a source, it is an `intermediate expression'.

Similarly for HTML.  `makeinfo' currently produces this ugly looking
output for that Texinfo source:

     <ol type=1 start=1>
<li>First item.  This item has a lot of text to show what happens when
it is multi-line.

     <li>Second item.

     <li>Third item.
        </ol>

(The HTML should look more like

<ol>
  <li> First item.  ....
  <li> Second item.  
  <li> Third item.  
</ol>

but this is a digression.)

Again the HTML is a surface expression in one circumstance (such as
here in the mail message) and a source in another, such as when I look
at my `test.html' file in Firefox.  The term `intermediate expression'
helps clarify this.

A Lisp object representation is, from this point of view, another
`intermediate expression'.  It is not the "encoded document file" nor
is it what a novice user looks at or listens to.  (When a programmer
works with the Lisp object representation, then it is to him a
`surface expression.)

In current Emacs Enriched mode, the deep representation is the version
that is seen by `find-file-literally'.  It has lots of angle brackets.
The surface expression has colors (or if you listen to it, it has
different voices, I think).

In Enriched mode, the Lisp object representation is an `intermediate
expression'.

Of course, there are more steps to each process.  For example, when
you view an HTML file in Emacs W3 mode, the (simpliefied) sequence
goes like this:


test.texi           -->        test.html        -->     W3 buffer

deep representation --> intermediate expression --> surface expression
                    |                           | 
                    V                           V
      the `makeinfo' transform       the W3 mode transform uses 
        uses temporary data           a Lisp object representation 
                                      as an `intermediate expression'

And depending on how you look at it, `test.html' may serve as a `deep
representation' or as a `surface expression'.

-- 
    Robert J. Chassell                         
    address@hidden                         GnuPG Key ID: 004B4AC8
    http://www.rattlesnake.com                  http://www.teak.cc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]