emacs-devel
[Top][All Lists]
Advanced

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

Re: Rectangular regions


From: Stefan Monnier
Subject: Re: Rectangular regions
Date: Thu, 31 Oct 2013 21:50:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Or better yet --- just take an interval list.

Or provide a `region-iterator-function', so that count-words could do
something like:

   (let ((total 0))
     (funcall region-iterator-function
              (lambda (beg end)
                (cl-incf total (count-words-internal beg end))))
     total)

I'm not sure yet what this really should look like.  We'll need to take
a closer look at the various uses of the region and see what primitives
would be useful.

Some of the issues have to do with modifying the buffer while we go
through the various chunks of the region, as well as dealing with things
like "the region starts in the middle of a TAB character" or "the region
starts/ends after the end of the line".

> An interval list would allow us to select a "rectangle" in bidi
> buffers, the underlying character-range chunks of which would actually
> be arbitrary and non-contiguous.

I'm in no hurry to go down that path.  Lots of potholes on the way, and
from where I stand, there doesn't seem to be much gold at the end of
that road.


        Stefan



reply via email to

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