[Top][All Lists]

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

Re: enriched-mode and switching major modes.

From: Kai Grossjohann
Subject: Re: enriched-mode and switching major modes.
Date: Tue, 21 Sep 2004 11:53:41 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

> Because of Lisp, a similar thing happens for text in an Emacs buffer.
> In a typical word processor, text has a visual appearance and a way it
> is saved in a file, that's all.  In Emacs, text has a visual
> appearance, a way it is saved in a file, and the way it appears as
> Lisp data.  We have to design all three.

Talking about the Lisp representation, consider an enumerated list
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.

What should Lisp see and what shouldn't it see?

I would expect Emacs to compute the numbers automatically, so that
inserting an item into the middle would recompute the numbers.  To me,
this means it makes no sense to make the numbers themselves accessible
via Lisp.  But Lisp should see that there is an enumerated list using
the "1." numbering style (as opposed to "1)" or "1/", say), and Lisp
should see that the list has three items.

I would also expect the line spacing between the items to vary
depending on the style sheet.  That is, Lisp shouldn't see two newline
characters after "multi-line.", but just the end of the first item.

Now let's talk about the newlines and spaces between "when" and "it"
(in the first item).  Suppose you decide that you want the item
numbers to come out bold.  Often, bold weight runs longer than medium
weight.  This means that the indentation of the "it" line might grow a
bit.  Does it really make sense to insert more spaces in front of "it"
just because the user has changed the style sheet of the document to
specify that enumerations should use bold numbers?  Additionally,
depending on the exact text, making the numbers wider could mean that
the "when" does not fit on the line anymore.  Making the newlines
accessible via Lisp would mean that Lisp would suddenly see a newline
in front of "when", instead of after "when".

Now let's talk about cursor movement.  I think that positioning point
after "multi-line." and then hitting C-f should position point before
"Second".  The "2." part is not meaningfully editable, as it is
computed automatically.  The whitespace isn't meaningfully editable,
either, since the amount depends on the stylesheet in use.

I think that Lisp should have access to the stylesheet information,
though.  That is much more useful than knowing that "when" happens to
be at the end of a line.  For instance, I want to be able to search
for enumeration items containing the word "when".  (The search should
ignore "when" occurring outside of enumerations.)

What do people think?


reply via email to

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