guile-devel
[Top][All Lists]
Advanced

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

text buffers (was Re: Unicode and Guile)


From: Stephen Compall
Subject: text buffers (was Re: Unicode and Guile)
Date: 03 Nov 2003 13:35:33 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

> There's a need for a new type, `text', which acts like the text
> contents of an emacs buffer and has (yes I agree) pretty much the
> Emacs interface. It should all be designed so that, internally,
> people can write new ways to represent text objects and multiple
> text object representations can coexist in the same application
> (just like emacs).  There's no good reason not to throw in
> attributes, overlays, and markers for text objects too (just like
> emacs).

I am working on sort-of transcribing the code in emacs/src/buffer.[hc]
into a "buffer" data type in a Guile module.  I need this because I am
terribly dependent on buffers for almost any kind of data processing
:)

The advantages of transcribing Emacs source are fewer bugs and
carrying over the lovely optimizations, like the gap, that make
buffers work.

Right now, markers are part of the `impl_buffer' C data type.  The
intention of `impl_buffer' is to push most of the "good" interface out
to a goops class.  However, some of the details, like overlays, may be
better to leave as object properties or new behavior in subclasses,
rather than explicitly in impl_buffer as Emacs does it.  And then just
specify that even when (point buf) => 100, and (- (point-max buf)
(point-min buf)) => something over 100, (forward-char buf) won't
necessarily make (point buf) => 101 :)

The other interesting extension is making markers ports.  Generics
also provide a solution to the whole "current buffer" annoyance.

On a tangent, would it be useful to generalize the gap concept to be
available to any collection, not just ordered collections of
characters?

--
Stephen Compall or s11 or sirian

Intellect annuls Fate.
So far as a man thinks, he is free.
                -- Ralph Waldo Emerson

afsatcom INSCOM JPL broadside Defcon Waco, Texas BCCI kibo Ermes Reno
Crypto AG Telex jihad Panama 22nd SAS




reply via email to

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