[Top][All Lists]

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

Re: Structural regular expressions

From: Kan-Ru Chen
Subject: Re: Structural regular expressions
Date: Wed, 8 Sep 2010 18:30:50 +0800

On Wed, Sep 8, 2010 at 5:20 PM, Lawrence Mitchell <address@hidden> wrote:
> Stefan Monnier wrote:
>>> Would generalizing the narrowing behavior to arbitrarily many ranges in
>>> a buffer instead of a single range have extensive ramifications?  Would
>>> this be an easy or difficult thing to implement?
>> Since the non-narrowed part is not displayed at all, it wouldn't be
>> quite what we want anyway.
>> We'd need to add something new, tho it could be based on something
>> pre-existing (e.g. it could rely on text properties like to `invisible'
>> and/or `intangible').
>>> If it's not too difficult then providing behavior like that mentioned in
>>> the article above should be trivial.
>> Nothing's trivial when you have to ensure some amount of backward
>> compatibility with code written many years ago ;-)
>> But of course, it would be OK to start with something that may break
>> pre-existing code, as long as it's only broken when you use the
>> new feature.
>> And I agree with Lennart, that such a new tool, if done right, could be
>> a good basis for better multi-mode support.
> A halfway house, similar to that suggested by Drew, would be
> something like
> http://www2.ph.ed.ac.uk/~s0198183/multi-region.el.  ISTR some
> discussion when it was posted in g.e.sources, *grovels through
> mail*:
> http://thread.gmane.org/gmane.emacs.sources/1390
> Maybe this is a useful feature to now think about incorporating
> :P.

Could this be implemented like a `virtual-buffer'.

  (with-virtual-buffer LABEL &rest BODY)

>From the virtual-buffer point of view, the multiple regions marked by
LABEL are as a whole, connected buffer. Then legacy code could work on
this buffer without change.

- Kanru

reply via email to

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