File: ewoc.el.html

Ewoc Was Once Cookie But now it's Emacs's Widget for Object Collections

As the name implies this derives from the cookie package (part of Elib). The changes are pervasive though mostly superficial:

- uses CL (and its defstruct)
- separate from Elib.
- uses its own version of a doubly-linked list which allows us
  to merge the elib-wrapper and the elib-node structures into ewoc-node
- dropping functions not used by PCL-CVS (the only client of ewoc at the
  time of writing)
- removing unused arguments
- renaming:
  elib-node ==> ewoc--node
  collection ==> ewoc
  tin ==> ewoc--node
  cookie ==> data or element or elem

    Introduction
    ============

Ewoc is a package that implements a connection between an dll (a doubly linked list) and the contents of a buffer. Possible uses are Dired (have all files in a list, and show them), buffer-list, kom-prioritize (in the LysKOM elisp client) and others. pcl-cvs.el and vc.el use ewoc.el.

Ewoc can be considered as the view part of a model-view-controller.

An element can be any Lisp object. When you use the ewoc package you specify a pretty-printer, a function that inserts a printable representation of the element in the buffer. (The pretty-printer should use "insert" and not
"insert-before-markers").

A ewoc consists of a doubly linked list of elements, a header, a footer and a pretty-printer. It is displayed at a certain point in a certain buffer. (The buffer and point are fixed when the ewoc is created). The header and the footer are constant strings. They appear before and after the elements.

Ewoc does not affect the mode of the buffer in any way. It merely makes it easy to connect an underlying data representation to the buffer contents.

A ewoc--node is an object that contains one element. There are functions in this package that given an ewoc--node extract the data, or give the next or previous ewoc--node. (All ewoc--nodes are linked together in a doubly linked list. The previous ewoc--node is the one that appears
before the other in the buffer.) You should not do anything with
an ewoc--node except pass it to the functions in this package.

An ewoc is a very dynamic thing. You can easily add or delete elements. You can apply a function to all elements in an ewoc, etc, etc.

Remember that an element can be anything. Your imagination is the
limit! It is even possible to have another ewoc as an
element. In that way some kind of tree hierarchy can be created.

The Emacs Lisp Reference Manual documents ewoc.el's "public interface".

    Coding conventions
    ==================

All functions of course start with ewoc. Functions and macros starting with the prefix ewoc-- are meant for internal use, while those starting with ewoc- are exported for public use.

Defined variables (0)

Defined functions (64)

copy-ewoc(ARG)
copy-ewoc--node(ARG)
ewoc--adjust(BEG END NODE DLL)
ewoc--buffer(ewoc--buffer X)
ewoc--buffer--inliner(INLINE--FORM X)
ewoc--create(BUFFER PRETTY-PRINTER DLL)
ewoc--create--cmacro(CL-WHOLE-ARG BUFFER PRETTY-PRINTER DLL)
ewoc--dll(ewoc--dll X)
ewoc--dll--inliner(INLINE--FORM X)
ewoc--filter-hf-nodes(EWOC NODE)
ewoc--footer(ewoc--footer X)
ewoc--footer--inliner(INLINE--FORM X)
ewoc--header(ewoc--header X)
ewoc--header--inliner(INLINE--FORM X)
ewoc--hf-pp(ewoc--hf-pp X)
ewoc--hf-pp--inliner(INLINE--FORM X)
ewoc--insert-new-node(NODE DATA PRETTY-PRINTER DLL)
ewoc--last-node(ewoc--last-node X)
ewoc--last-node--inliner(INLINE--FORM X)
ewoc--node-create(START-MARKER DATA)
ewoc--node-create--cmacro(CL-WHOLE-ARG START-MARKER DATA)
ewoc--node-data(ewoc--node-data X)
ewoc--node-data--inliner(INLINE--FORM X)
ewoc--node-left(ewoc--node-left X)
ewoc--node-left--inliner(INLINE--FORM X)
ewoc--node-next(DLL NODE)
ewoc--node-nth(DLL N)
ewoc--node-prev(DLL NODE)
ewoc--node-right(ewoc--node-right X)
ewoc--node-right--inliner(INLINE--FORM X)
ewoc--node-start-marker(ewoc--node-start-marker X)
ewoc--node-start-marker--inliner(INLINE--FORM X)
ewoc--pretty-printer(ewoc--pretty-printer X)
ewoc--pretty-printer--inliner(INLINE--FORM X)
ewoc--refresh-node(PP NODE DLL)
ewoc--set-buffer-bind-dll(EWOC &rest FORMS)
ewoc--set-buffer-bind-dll-let*(EWOC VARLIST &rest FORMS)
ewoc--wrap(FUNC)
ewoc-buffer(EWOC)
ewoc-collect(EWOC PREDICATE &rest ARGS)
ewoc-create(PRETTY-PRINTER &optional HEADER FOOTER NOSEP)
ewoc-data(NODE)
ewoc-delete(EWOC &rest NODES)
ewoc-enter-after(EWOC NODE DATA)
ewoc-enter-before(EWOC NODE DATA)
ewoc-enter-first(EWOC DATA)
ewoc-enter-last(EWOC DATA)
ewoc-filter(EWOC PREDICATE &rest ARGS)
ewoc-get-hf(EWOC)
ewoc-goto-next(EWOC ARG)
ewoc-goto-node(EWOC NODE)
ewoc-goto-prev(EWOC ARG)
ewoc-invalidate(EWOC &rest NODES)
ewoc-locate(EWOC &optional POS GUESS)
ewoc-location(NODE)
ewoc-map(MAP-FUNCTION EWOC &rest ARGS)
ewoc-next(EWOC NODE)
ewoc-nth(EWOC N)
ewoc-p(X)
ewoc-p--inliner(INLINE--FORM X)
ewoc-prev(EWOC NODE)
ewoc-refresh(EWOC)
ewoc-set-data(NODE DATA)
ewoc-set-hf(EWOC HEADER FOOTER)

Defined faces (0)