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: Fri, 17 Sep 2004 15:08:17 +0000 (UTC)

   >     I mean "the document's character data" here.  The important point is
   >     that formats suitable for WP (RTF, HTML ...) separate character data
   >     from formatting information entirely.
   >
   > My point is that this is exactly what we must not do in Emacs, lest it
   > ruin everything in a subtle way.

I think there is a confusion here:  internally, Emacs works with a
`deep representation'.  People mostly work with `surface expressions'.
Nowadays, the two can be different.  In the old days, they were similar.

(Oliver Scholz calls a deep representation the `encoded document file'
and the surface expression the `visual (aural) representation' or
`rendering'.)

An Info file has a `deep representation' that you can see with
`find-file-literally'.  

But many people look at Info files using `info' -- and what they see
(or hear) is a `surface expression'.  The Info `rendering' may convert
a chapter heading with a line of asterisks below it to a heading
without the asterisks and with a different font or voice.

In its earliest days, Emacs always used what we now call
`find-file-literally'.  The rendering you saw was the deep
representation.

But ever since text properties and overlays were introduced, the deep
representation has become different, or potentially different, from
its rendering.  (Images also look different than their deep
representation.)

The question is how far to go?

  * Should an HTML formatted line be displayed with <em>
    formatting </em> commands in it, as it is when using `find-file'
    or `find-file-literally', but with a different font or voice for
    the emphasized word when in W3 mode?  (This is how it is now.)

  * Should a surface expression or rendering that is quite different
    from the deep representation be presented only in a read-only
    buffer?  Or should a person be able to edit that rendering and be
    confident that the underlying `encoded document file' or deep
    representation will incorporate the correct tag?

    Put another way, when you type a command such as `C-c C-c i'
    (tempo-template-html-emphasized) in a buffer in HTML Helper mode,
    the string `<em></em>' is inserted.

    Should you also be able to type that same command into a buffer in
    W3 mode and have that string be inserted properly in the `encoded
    document file'?

Enriched mode illustrates this very well.  When you run `find-file' on
etc/enriched.doc you will see a line like this

    Colors: anything your screen can display...

but with many colors.  However, if you run `find-file-literally' on
that same file, that line looks like this:

    <bold>Colors:</bold> 
<x-color><param>red</param><x-bg-color><param>DarkSlateGray</param><indent>any</indent></x-bg-color></x-color><x-bg-color><param>DarkSlateGray</param><indent><x-color><param>orange</param>thing</x-color>
 <x-color><param>yellow</param>your</x-color><x-color><param>green</param> 
screen</x-color><x-color><param>blue</param> </x-color><x-color><param>light 
blue</param>can</x-color><x-color><param>violet</param> 
display...</x-color></indent></x-bg-color>

The surface expression or rendering is different from the deep
representation.

Emacs already has shifted away from its beginnings.

The question is not whether

    ... the appearance is represented by text in the buffer.  

That misses the point.  One kind of appearance should always be shown
when you run `find-file-literally'.  That should represent what is
saved, the `encoded document file'.  That should be what is shown when
you run `cat' on the file in a command line interface.

The other kind of appearance should be shown when a display mode is
invoked, as with Enriched mode and `find-file' or  W3 mode and `w3'.

The basic question is whether to install writing capabilities in
surface expression buffers.  Should typing `C-c C-c i' in a W3 mode
buffer insert `<em></em>' in a deep representation buffer?

(If the latter, you should be able to look at the same HTML encoded
buffer in several different modes in different windows:  in W3 mode,
in HTML Helper mode, and in whatever minor mode `find-file-literally'
uses.)

Texinfo already has one deep representation or `encoded document' form
that is shown by `find-file-literally' and five `surface expressions'.
(The surface renderings, however, do not come from the same file as
the deep representation.)

    Texinfo mode, which is read-writable 
    Info mode (and Emacspeak aural from Info)
    HTML
    XML
    DVI (and other printed)

In the old days, surface expression rendering came directly from the
rendition of the `encoded document' form, just like 
`find-file-literally' does now.

Info showed files with asterisks below a chapter title.  In those
days, the only way to display the same document differently in
different modes was to use different files.  That ended and so
`find-file-literally' had to be invented.

At the moment, in Texinfo, the Texinfo mode (or `find-file-literally')
file is writable.  You cannot edit an Info expression and have the
results show well in a printed book.

Incidentally, I regularly use four of these renderings.  I write and
edit in Texinfo mode and I publish the resulting document in Info,
HTML, DVI, PDF, and PostScript.

-- 
    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]