diff options
Diffstat (limited to 'devdocs/elisp/abstract-display-functions.html')
| -rw-r--r-- | devdocs/elisp/abstract-display-functions.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/devdocs/elisp/abstract-display-functions.html b/devdocs/elisp/abstract-display-functions.html new file mode 100644 index 00000000..b6311aab --- /dev/null +++ b/devdocs/elisp/abstract-display-functions.html @@ -0,0 +1,52 @@ + <h4 class="subsection">Abstract Display Functions</h4> <p>In this subsection, <var>ewoc</var> and <var>node</var> stand for the structures described above (see <a href="abstract-display">Abstract Display</a>), while <var>data</var> stands for an arbitrary Lisp object used as a data element. </p> <dl> <dt id="ewoc-create">Function: <strong>ewoc-create</strong> <em>pretty-printer &optional header footer nosep</em> +</dt> <dd> +<p>This constructs and returns a new ewoc, with no nodes (and thus no data elements). <var>pretty-printer</var> should be a function that takes one argument, a data element of the sort you plan to use in this ewoc, and inserts its textual description at point using <code>insert</code> (and never <code>insert-before-markers</code>, because that would interfere with the Ewoc package’s internal mechanisms). </p> <p>Normally, a newline is automatically inserted after the header, the footer and every node’s textual description. If <var>nosep</var> is non-<code>nil</code>, no newline is inserted. This may be useful for displaying an entire ewoc on a single line, for example, or for making nodes invisible by arranging for <var>pretty-printer</var> to do nothing for those nodes. </p> <p>An ewoc maintains its text in the buffer that is current when you create it, so switch to the intended buffer before calling <code>ewoc-create</code>. </p> +</dd> +</dl> <dl> <dt id="ewoc-buffer">Function: <strong>ewoc-buffer</strong> <em>ewoc</em> +</dt> <dd><p>This returns the buffer where <var>ewoc</var> maintains its text. </p></dd> +</dl> <dl> <dt id="ewoc-get-hf">Function: <strong>ewoc-get-hf</strong> <em>ewoc</em> +</dt> <dd><p>This returns a cons cell <code>(<var>header</var> . <var>footer</var>)</code> made from <var>ewoc</var>’s header and footer. </p></dd> +</dl> <dl> <dt id="ewoc-set-hf">Function: <strong>ewoc-set-hf</strong> <em>ewoc header footer</em> +</dt> <dd><p>This sets the header and footer of <var>ewoc</var> to the strings <var>header</var> and <var>footer</var>, respectively. </p></dd> +</dl> <dl> <dt id="ewoc-enter-first">Function: <strong>ewoc-enter-first</strong> <em>ewoc data</em> +</dt> <dt id="ewoc-enter-last">Function: <strong>ewoc-enter-last</strong> <em>ewoc data</em> +</dt> <dd><p>These add a new node encapsulating <var>data</var>, putting it, respectively, at the beginning or end of <var>ewoc</var>’s chain of nodes. </p></dd> +</dl> <dl> <dt id="ewoc-enter-before">Function: <strong>ewoc-enter-before</strong> <em>ewoc node data</em> +</dt> <dt id="ewoc-enter-after">Function: <strong>ewoc-enter-after</strong> <em>ewoc node data</em> +</dt> <dd><p>These add a new node encapsulating <var>data</var>, adding it to <var>ewoc</var> before or after <var>node</var>, respectively. </p></dd> +</dl> <dl> <dt id="ewoc-prev">Function: <strong>ewoc-prev</strong> <em>ewoc node</em> +</dt> <dt id="ewoc-next">Function: <strong>ewoc-next</strong> <em>ewoc node</em> +</dt> <dd><p>These return, respectively, the previous node and the next node of <var>node</var> in <var>ewoc</var>. </p></dd> +</dl> <dl> <dt id="ewoc-nth">Function: <strong>ewoc-nth</strong> <em>ewoc n</em> +</dt> <dd><p>This returns the node in <var>ewoc</var> found at zero-based index <var>n</var>. A negative <var>n</var> means count from the end. <code>ewoc-nth</code> returns <code>nil</code> if <var>n</var> is out of range. </p></dd> +</dl> <dl> <dt id="ewoc-data">Function: <strong>ewoc-data</strong> <em>node</em> +</dt> <dd><p>This extracts the data encapsulated by <var>node</var> and returns it. </p></dd> +</dl> <dl> <dt id="ewoc-set-data">Function: <strong>ewoc-set-data</strong> <em>node data</em> +</dt> <dd><p>This sets the data encapsulated by <var>node</var> to <var>data</var>. </p></dd> +</dl> <dl> <dt id="ewoc-locate">Function: <strong>ewoc-locate</strong> <em>ewoc &optional pos guess</em> +</dt> <dd><p>This determines the node in <var>ewoc</var> which contains point (or <var>pos</var> if specified), and returns that node. If <var>ewoc</var> has no nodes, it returns <code>nil</code>. If <var>pos</var> is before the first node, it returns the first node; if <var>pos</var> is after the last node, it returns the last node. The optional third arg <var>guess</var> should be a node that is likely to be near <var>pos</var>; this doesn’t alter the result, but makes the function run faster. </p></dd> +</dl> <dl> <dt id="ewoc-location">Function: <strong>ewoc-location</strong> <em>node</em> +</dt> <dd><p>This returns the start position of <var>node</var>. </p></dd> +</dl> <dl> <dt id="ewoc-goto-prev">Function: <strong>ewoc-goto-prev</strong> <em>ewoc arg</em> +</dt> <dt id="ewoc-goto-next">Function: <strong>ewoc-goto-next</strong> <em>ewoc arg</em> +</dt> <dd><p>These move point to the previous or next, respectively, <var>arg</var>th node in <var>ewoc</var>. <code>ewoc-goto-prev</code> does not move if it is already at the first node or if <var>ewoc</var> is empty, whereas <code>ewoc-goto-next</code> moves past the last node, returning <code>nil</code>. Excepting this special case, these functions return the node moved to. </p></dd> +</dl> <dl> <dt id="ewoc-goto-node">Function: <strong>ewoc-goto-node</strong> <em>ewoc node</em> +</dt> <dd><p>This moves point to the start of <var>node</var> in <var>ewoc</var>. </p></dd> +</dl> <dl> <dt id="ewoc-refresh">Function: <strong>ewoc-refresh</strong> <em>ewoc</em> +</dt> <dd><p>This function regenerates the text of <var>ewoc</var>. It works by deleting the text between the header and the footer, i.e., all the data elements’ representations, and then calling the pretty-printer function for each node, one by one, in order. </p></dd> +</dl> <dl> <dt id="ewoc-invalidate">Function: <strong>ewoc-invalidate</strong> <em>ewoc &rest nodes</em> +</dt> <dd><p>This is similar to <code>ewoc-refresh</code>, except that only <var>nodes</var> in <var>ewoc</var> are updated instead of the entire set. </p></dd> +</dl> <dl> <dt id="ewoc-delete">Function: <strong>ewoc-delete</strong> <em>ewoc &rest nodes</em> +</dt> <dd><p>This deletes each node in <var>nodes</var> from <var>ewoc</var>. </p></dd> +</dl> <dl> <dt id="ewoc-filter">Function: <strong>ewoc-filter</strong> <em>ewoc predicate &rest args</em> +</dt> <dd><p>This calls <var>predicate</var> for each data element in <var>ewoc</var> and deletes those nodes for which <var>predicate</var> returns <code>nil</code>. Any <var>args</var> are passed to <var>predicate</var>. </p></dd> +</dl> <dl> <dt id="ewoc-collect">Function: <strong>ewoc-collect</strong> <em>ewoc predicate &rest args</em> +</dt> <dd><p>This calls <var>predicate</var> for each data element in <var>ewoc</var> and returns a list of those elements for which <var>predicate</var> returns non-<code>nil</code>. The elements in the list are ordered as in the buffer. Any <var>args</var> are passed to <var>predicate</var>. </p></dd> +</dl> <dl> <dt id="ewoc-map">Function: <strong>ewoc-map</strong> <em>map-function ewoc &rest args</em> +</dt> <dd><p>This calls <var>map-function</var> for each data element in <var>ewoc</var> and updates those nodes for which <var>map-function</var> returns non-<code>nil</code>. Any <var>args</var> are passed to <var>map-function</var>. </p></dd> +</dl><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Abstract-Display-Functions.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Abstract-Display-Functions.html</a> + </p> +</div> |
