[Top][All Lists]

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

Re: enriched-mode and switching major modes.

From: Richard Stallman
Subject: Re: enriched-mode and switching major modes.
Date: Tue, 21 Sep 2004 14:30:53 -0400

    When rendered by a graphical, CSS2-enabled browser, you'll see two
    paragraphs on a gray background sourounded by a dashed border.  Those
    two paragraphs are again contained in a larger paragraph on a purple
    background surounded by a solid border.

It will be very hard to implement this in a way that fits in with

The text property feature has been designed to work well with all
kinds of commands that copy text.  What makes it work well is that
text properties are per character.  So if you copy each character with
its properties, everything works ok.  Emacs primitives that copy text
all do this.

I am not sure how to represent nested blocks with per-character text
properties.  In principle we could have other kinds of data associated
with the text to supplement text properties, but what could we design
that would fit in properly with cut and paste?

What does it *mean* to copy a character from inside environment
`larum' which is inside environment `lirum' and insert it somewere
else?  What should that character look like in its new location?

One possible approach is to use markup characters, put the properties
on the markup characters (or express them in the text), and make these
markup characters more or less invisible in formatted display mode.
Then we would use text props only for fontification, etc., within a

However, it is worth doing this only if the result is an improvement.
I'm not sure of that.  For instance:

    <h1>Some <i>meaningless</i> heading</h1>

    The <i> element maps directly to text properties, of course.  But the
    h1 element both demands that its contents be rendered as a paragraph
    (a block) /and/ specifies certain character formatting properties for
    the whole of it, e.g. a large bold font.

    When encoding a buffer, I need to identify the whole paragraph as
    being of the type "h1".  I.e. I have to distinguish it from:

    <p><font size=7><b>Some <i>meaningless</i> heading</font></p>

Why do you have to distinguish them?  Why wouldn't it work simply to
put these properties on the whole text of the paragraph?  What aspect
would work differently as a result of doing one or the other, and why
is it better if the properties are attached to paragraphs?

    We have to deal with the case that a user deletes the hard newline (if
    you evaluate the code above: just hit backspace).  Is the resulting
    paragraph of type `h1' or of type `h2'?

Why ask the question?  Why not just accept that it's a paragraph
of partly h1 text and partly h2 text?

    I don't think that looking at indentation and newlines could at any
    rate be enough for something as complex as a WP document.

It's a matter of what the specific command does.  We're talking about
commands not written specifically for word-processing documents,
general-purpose code.

reply via email to

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