emacs-devel
[Top][All Lists]
Advanced

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

RE: A vision for multiple major modes: some design notes


From: Drew Adams
Subject: RE: A vision for multiple major modes: some design notes
Date: Wed, 20 Apr 2016 16:00:28 -0700 (PDT)

I said:

> And I would probably want user-level operations, to
> combine chains (append, intersect, union/coalesce,
> difference).

And complement - get a new chain as the complement of a
chain, i.e., the islands of one are the non-islands of the
other.  You should easily be able to search etc. _outside_
the islands of a given chain.

--

I did that for zones.el, for instance:

  zz-zones-complement is a Lisp function in `zones.el'.
  (zz-zones-complement ZONES &optional BEG END BUFFER)

  Return a list of zones that is the complement of ZONES, from BEG to END.
  ZONES is assumed to be a union, i.e., sorted by car, with no overlaps.
  Any extra info in a zone of ZONES, i.e., after the cadr, is ignored.

(The bit about being a union and sorted by car just means
that the list of zones must be like your chain of islands:
no overlaps and ordered by buffer position.  The bit about
ignoring cadr has to do with the fact that a zone (~island)
can contain other information, in addition to its limits.)



reply via email to

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