The cl-gap-buffer Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-gap-buffer Reference Manual

This is the cl-gap-buffer Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:39:25 2022 GMT+0.

Table of Contents


1 Introduction

#+TITLE: The =CL-GAP-BUFFER= Library
#+AUTHOR: Robert Smith
#+EMAIL: quad@symbo1ics.com

* Summary

A small library for efficient-local-insertion strings represented as
gap buffers. It operates efficiently for cursor-based editing.


* Usage

The principle use follows. Mutable operations' output is elided.

Create a gap buffer.

    : > (defparameter buf (make-gap-buffer))

Add some data to it.

    : > (gap-buffer-insert-string buf "hello")
    : > (gap-buffer-string buf)
    : "hello"
    : > (gap-buffer-insert-char buf #\a)
    : > (gap-buffer-string buf)
    : "helloa"

Move about in the gap buffer.

    : > (gap-buffer-move-left buf)
    : > (gap-buffer-move-left buf)
    : > (gap-buffer-insert-char buf #\y)
    : > (gap-buffer-string buf)
    : "hellyoa"

Remove characters.

    : > (gap-buffer-move-right buf)
    : > (gap-buffer-backspace buf)
    : > (gap-buffer-string buf)
    : "hellya"
    : > (gap-buffer-insert-char buf #\e)
    : > (gap-buffer-string buf)
    : "hellyea"
    : > (gap-buffer-delete buf)
    : > (gap-buffer-string buf)
    : "hellye"
    : > (gap-buffer-insert-char buf #\s)
    : > (gap-buffer-string buf)
    : "hellyes"


* Dependencies

None.


* License

See the file ~LICENSE~.

----------
### End of file


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-gap-buffer

Gap buffers in Common Lisp.

Maintainer

Robert Smith

Author

Robert Smith

Long Description

An implementation of gap buffers in Common Lisp.

Version

0.1

Source

cl-gap-buffer.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 cl-gap-buffer/cl-gap-buffer.asd

Source

cl-gap-buffer.asd.

Parent Component

cl-gap-buffer (system).

ASDF Systems

cl-gap-buffer.

Packages

cl-gap-buffer-asd.


3.1.2 cl-gap-buffer/package.lisp

Source

cl-gap-buffer.asd.

Parent Component

cl-gap-buffer (system).

Packages

cl-gap-buffer.


3.1.3 cl-gap-buffer/gap-buffer.lisp

Dependency

package.lisp (file).

Source

cl-gap-buffer.asd.

Parent Component

cl-gap-buffer (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 cl-gap-buffer

Gap buffer API.

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

Previous: , Up: Packages   [Contents][Index]

4.2 cl-gap-buffer-asd

Source

cl-gap-buffer.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Special variables

Special Variable: *gap-buffer-growth*

Positive integer specifying how much the buffer should grow if the gap closes.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.


5.1.2 Ordinary functions

Function: gap-buffer-backspace (buf)

Backward-delete a character in the gap buffer BUF.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-clear (buf)

Clear the contents of the gap buffer BUF.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-components (buf)

Return the string before the gap and after the gap in the gap buffer BUF.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-delete (buf)

Forward-delete a character in the gap buffer BUF.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-insert-char (buf char)

Insert a character CHAR into a gap buffer BUF at the gap, resizing if needed.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-insert-string (buf string)

Insert a string STRING into the gap buffer BUF.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-length (buf)

Find the length of the gap buffer BUF. Analogous to LENGTH.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-move-left (buf)

Move the gap left in the gap buffer BUF.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-move-right (buf)

Move the gap to the right in the gap buffer BUF.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-p (object)
Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-string (buf)

Format a gap buffer BUF into a string.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: make-gap-buffer (&optional length)

Make a new gap buffer of size LENGTH.

Package

cl-gap-buffer.

Source

gap-buffer.lisp.


5.1.3 Standalone methods

Method: print-object ((object gap-buffer) stream)
Source

gap-buffer.lisp.


5.1.4 Structures

Structure: gap-buffer
Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: data
Readers

buf.data.

Writers

(setf buf.data).

Slot: gap-start
Readers

buf.gap-start.

Writers

(setf buf.gap-start).

Slot: gap-end
Readers

buf.gap-end.

Writers

(setf buf.gap-end).


5.2 Internals


Previous: , Up: Internals   [Contents][Index]

5.2.1 Ordinary functions

Reader: buf.data (instance)
Writer: (setf buf.data) (instance)
Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Target Slot

data.

Reader: buf.gap-end (instance)
Writer: (setf buf.gap-end) (instance)
Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Target Slot

gap-end.

Reader: buf.gap-start (instance)
Writer: (setf buf.gap-start) (instance)
Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Target Slot

gap-start.

Function: copy-gap-buffer (instance)
Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-gap-length (buf)
Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: gap-buffer-print-function (buf stream depth)
Package

cl-gap-buffer.

Source

gap-buffer.lisp.

Function: make-raw-gap-buffer (&key data gap-start gap-end)
Package

cl-gap-buffer.

Source

gap-buffer.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
B   C   F   G   M   P  
Index Entry  Section

(
(setf buf.data): Private ordinary functions
(setf buf.gap-end): Private ordinary functions
(setf buf.gap-start): Private ordinary functions

B
buf.data: Private ordinary functions
buf.gap-end: Private ordinary functions
buf.gap-start: Private ordinary functions

C
copy-gap-buffer: Private ordinary functions

F
Function, (setf buf.data): Private ordinary functions
Function, (setf buf.gap-end): Private ordinary functions
Function, (setf buf.gap-start): Private ordinary functions
Function, buf.data: Private ordinary functions
Function, buf.gap-end: Private ordinary functions
Function, buf.gap-start: Private ordinary functions
Function, copy-gap-buffer: Private ordinary functions
Function, gap-buffer-backspace: Public ordinary functions
Function, gap-buffer-clear: Public ordinary functions
Function, gap-buffer-components: Public ordinary functions
Function, gap-buffer-delete: Public ordinary functions
Function, gap-buffer-gap-length: Private ordinary functions
Function, gap-buffer-insert-char: Public ordinary functions
Function, gap-buffer-insert-string: Public ordinary functions
Function, gap-buffer-length: Public ordinary functions
Function, gap-buffer-move-left: Public ordinary functions
Function, gap-buffer-move-right: Public ordinary functions
Function, gap-buffer-p: Public ordinary functions
Function, gap-buffer-print-function: Private ordinary functions
Function, gap-buffer-string: Public ordinary functions
Function, make-gap-buffer: Public ordinary functions
Function, make-raw-gap-buffer: Private ordinary functions

G
gap-buffer-backspace: Public ordinary functions
gap-buffer-clear: Public ordinary functions
gap-buffer-components: Public ordinary functions
gap-buffer-delete: Public ordinary functions
gap-buffer-gap-length: Private ordinary functions
gap-buffer-insert-char: Public ordinary functions
gap-buffer-insert-string: Public ordinary functions
gap-buffer-length: Public ordinary functions
gap-buffer-move-left: Public ordinary functions
gap-buffer-move-right: Public ordinary functions
gap-buffer-p: Public ordinary functions
gap-buffer-print-function: Private ordinary functions
gap-buffer-string: Public ordinary functions

M
make-gap-buffer: Public ordinary functions
make-raw-gap-buffer: Private ordinary functions
Method, print-object: Public standalone methods

P
print-object: Public standalone methods

Jump to:   (  
B   C   F   G   M   P