emacs-devel
[Top][All Lists]
Advanced

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

Re: Structural regular expressions


From: Lennart Borgman
Subject: Re: Structural regular expressions
Date: Fri, 10 Sep 2010 00:52:01 +0200

On Thu, Sep 9, 2010 at 10:47 PM, Davis Herring <address@hidden> wrote:
>> Indeed, we could probably go a long way by simply extending our notion
>> of region so as to allow it to be non-contiguous.
>>
>> Patches welcome,
>
> This is no patch, but I had an idea for the interface for this:
>
> Definition: simple region
> The interval (possibly empty) between point and mark, exactly as it is now.
>
> Variable: region-list
> A set of non-empty, disjoint intervals, always local to each buffer.  Each
> is a cons of two markers.  Typically each is highlighted in a subtle
> fashion, even outside Transient Mark Mode.
>
> Function: multi-region
> Returns the union of the region list and the simple region (using
> `point-marker' and/or `mark-marker' as needed).  (If the simple region is
> empty and the region list is not, the simple region is ignored and the
> return value equals `region-list'.)  This is the user-visible
> possibly-disconnected upgrade to the region concept.
>
> User option: multi-region-separator (default: "\n")
> String to insert between separate intervals of the multi-region when
> concatenated.
>
> (defun multi-region-string (&optional sep)
>  "Return the contents of the multi-region.
> Separate intervals with SEP (or `multi-region-separator' if omitted)."
...
>
> WDOT?


I think that kind of interface could be built upon a low level
interface, but the important thing to discus at this point is rather
the low level interface. Otherwise I think we might soon has multiple
ways of doing this.



reply via email to

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