The diff-match-patch Reference Manual

Table of Contents

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

The diff-match-patch Reference Manual

This is the diff-match-patch Reference Manual, version 0.2.1, generated automatically by Declt version 2.3 "Robert April" on Tue Jan 09 14:29:01 2018 GMT+0.


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

1 Introduction

This is a Common Lisp port of Neil Fraser's Diff, Match and Patch
library (http://code.google.com/p/google-diff-match-patch/).

It implements operations required for synchronizing sequences of Lisp
objects, in particular plain text represented as character strings.  The
operations fall into three subtasks:

1. Diff: Compare two sequences and return a list of differences (edit
   operations).

Diff implements Gene Myers's 1986 algorithm with complexity O(N * D),
where N is the sum of lengths of the two sequences, and D is the size
of the shortest edit script.

2. Match: Given a search sequence, find a (possibly fuzzily) matching
   subsequence of another sequence near a given position.

Match implements the Bitap algorithm, as described by Wu and Manber (1991).
Its broad idea is to search the space around the position first for an exact
occurence of the search pattern, then for a subsequence which matches the
pattern with one error, then with two errors, etc. If two or more matches
are found, they are compared by a score which trades off proximity and
number of errors.

3. Patch: Create a list of contextualized edit operation groups (“hunks”)
   corresponding to a diff of two sequences A and B; apply it to a third
   sequence A´ in order to produce an equivalent edit B´.

A hunk recording the changes of a subsequence S of A can be applied to a
subsequence S´ of A´ both when S and S´ are equal, and when S´ is a fuzzy
match of S in A´ near the position indicated by the hunk, and the badness of
the match (computed as the Levenshtein distance between S and S´ divided by
the length of S) is reasonably low.


The library defines the package DIFF-MATCH-PATH (nicknamed DMP), which
exports the following names:

{function} DIFF A B &KEY (TEST #'EQL)

   Find the differences between two sequences A and B of elements comparable
   under the function TEST. Return a list of edit operations of the form (OP
   X), where OP is one of the keywords :+ :- :=, and X is a subsequence of A
   or B.

{parameter} *DIFF-TIMEOUT*

   Number of seconds to refine a diff before giving up (NIL for infinity).
   Initial value = 5.0.

{parameter} *DIFF-EDIT-COST*

   Cost of an empty edit operation in terms of edit characters. Used to
   detect operationally trivial equalities when cleaning up diff lists.
   Initial value = 4.

{parameter} *DIFF-CHECK-LINES-LENGTH*
   When a diff is computed between strings, how long should they be to
   to qualify for line-level-diff optimization. On strings whose length
   is greater than this value, a line-level diff is run first to identify
   the changed areas. NIL = don't optimize. Initial value = 1000.

{function} MAPDIFF FN DIFFS

   Return a copy of edit operation list DIFFS in which the content of every
   operation has been replaced by its image under FN.

{function} DIFF-ORIGIN DIFFS

   Given a difference list, rebuild the first of the compared sequences.

{function} DIFF-DESTINATION DIFFS

   Given a difference list, rebuild the second of the compared sequences.

{function} TRANSLATE-POSITION DIFFS POSITION

   Given the difference list DIFFS between two sequences and a POSITION in
   the first sequence, return the equivalent position in the second sequence.

{function} LEVENSHTEIN DIFFS

   Given the difference list DIFFS between two sequences, return the
   corresponding Levenshtein distance.

{function} INDEX-ABBREVIATOR &OPTIONAL (HASH-TABLE-TEST #'EQUAL)

   Return two unary functions: one to abbreviate things to integers, the
   other to restore them from integer abbreviations.

{function} MATCH SPACE PATTERN POSITION &KEY (TEST #'EQL)

   Locate a subsequence most closely resembling PATTERN in SPACE near
   POSITION.

{parameter} *MATCH-THRESHOLD*

   At what point is no match declared (0.0 = perfection, 1.0 = very loose).
   Initial value = 0.5.

{parameter} *MATCH-DISTANCE*

   How far to search for a match (0 = exact location, 1000+ = broad match).
   A match this many characters away from the expected location will add
   1.0 to the error score (0.0 is a perfect match). Initial value = 1000.

{function} MAKE-PATCH A B &KEY (TEST #'EQL)
           MAKE-PATCH &KEY DIFFS (TEST #'EQL)

   When called with two seuqences A and B, compute the diff between them and
   convert it into a list of hunk objects.  Alternatively, the diff can be
   passed explicitly by keyword argument, and sequences reconstructed from
   it.

{function} WRITE-CHARS-PATCH PATCH &OPTIONAL (OUT *STANDARD-OUTPUT*)

   Write the formatted representation of the given PATCH (a hunk or list of
   hunks, encoding a difference of character strings) to the stream OUT.

{function} READ-CHARS-PATCH &OPTIONAL (IN *STANDARD-INPUT*)

   Read a formatted representation of patch encoding a difference of
   character strings from the stream IN and return it as a list of hunks.

{function} WRITE-LINES-PATCH PATCH &OPTIONAL (OUT *STANDARD-OUTPUT*)

   Write the formatted representation of the given PATCH (a hunk or list of
   hunks, encoding a difference of line sequences) to the stream OUT.

{function} READ-LINES-PATCH &OPTIONAL (IN *STANDARD-INPUT*) (SEQ-TYPE 'VECTOR)

   Read a formatted representation of patch encoding a difference of line
   sequences from the stream IN and return it as a list of hunks.  The type
   of line sequences in hunk difference lists is determined by the parameter
   SEQ-TYPE (which normally should be one of the symbols VECTOR or LIST).

{class} HUNK
{accessor} HUNK-DIFFS HUNK
{accessor} HUNK-START-A HUNK
{accessor} HUNK-START-B HUNK
{accessor} HUNK-LENGTH-A HUNK
{accessor} HUNK-LENGTH-B HUNK

   A wrapper for an edit or group of adjacent edits.

{function} APPLY-PATCH PATCH SEQ
               &KEY (PADDING #'DMP::TRIVIAL-PADDING) (TEST #'EQL)

   Apply PATCH (a list of hunks) to the sequence SEQ.  Return two values:
   (1) SEQ, or its modified copy; and (2) a list of booleans, of the same
   length as PATCH, indicating for every hunk if it could be applied.

{parameter} *PATCH-DELETE-THRESHOLD*

   When deleting a large block of text (over ~64 characters), how close do
   the contents have to be to match the expected contents. (0.0 = perfection,
   1.0 = very loose).  Note that *MATCH-THRESHOLD* controls how closely the
   end points of a delete need to match. Initial value = 0.5.

{parameter} *PATCH-MARGIN*

  Chunk size for context length. Initial value = 4.

{parameter} *MAX-BITS*

   The number of bits in an int, used to limit the width of match patterns
   when applying an inexact patch.Initial value = (INTEGER-LENGTH
   MOST-POSITIVE-FIXNUM). Common Lisp having bigints allows to set this
   value to NIL (meaning unlimited width), but keeping it as it is optimizes
   performance by using fixints only.


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

2 Systems

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


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

2.1 diff-match-patch

Maintainer

Boris Smilga <boris.smilga@gmail.com>

Author

Neil Fraser; ported by Boris Smilga

License

Apache 2.0

Description

A Common Lisp port of Neil Fraser’s library of the same name

Version

0.2.1

Dependencies
Source

diff-match-patch.asd (file)

Component

src (module)


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

3 Modules

Modules are listed depth-first from the system components tree.


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

3.1 diff-match-patch/src

Parent

diff-match-patch (system)

Location

Components

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

4 Files

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


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

4.1 Lisp


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

4.1.1 diff-match-patch.asd

Location

diff-match-patch.asd

Systems

diff-match-patch (system)

Packages

dmp-system


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

4.1.2 diff-match-patch/src/package.lisp

Parent

src (module)

Location

package.lisp

Packages

diff-match-patch

Exported Definitions

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

4.1.3 diff-match-patch/src/lib.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

lib.lisp

Internal Definitions

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

4.1.4 diff-match-patch/src/diff.lisp

Dependency

lib.lisp (file)

Parent

src (module)

Location

diff.lisp

Exported Definitions
Internal Definitions

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

4.1.5 diff-match-patch/src/cleanup.lisp

Dependency

diff.lisp (file)

Parent

src (module)

Location

cleanup.lisp

Internal Definitions

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

4.1.6 diff-match-patch/src/match.lisp

Dependency

cleanup.lisp (file)

Parent

src (module)

Location

match.lisp

Exported Definitions

match (function)

Internal Definitions

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

4.1.7 diff-match-patch/src/patch.lisp

Dependency

match.lisp (file)

Parent

src (module)

Location

patch.lisp

Exported Definitions
Internal Definitions

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

5 Packages

Packages are listed by definition order.


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

5.1 dmp-system

Source

diff-match-patch.asd

Use List

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

5.2 diff-match-patch

Source

package.lisp (file)

Nickname

dmp

Use List
Exported Definitions
Internal Definitions

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

6 Definitions

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


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

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Special variables

Special Variable: *diff-check-lines-length*

When a diff is computed between strings, how long should they be to to qualify for line-level-diff optimization. On strings whose length is greater than this value, a line-level diff is run first to identify the changed areas. NIL = don’t optimize.

Package

diff-match-patch

Source

package.lisp (file)

Special Variable: *diff-edit-cost*

Cost of an empty edit operation in terms of edit characters. Used to detect operationally trivial equalities when cleaning up diff lists.

Package

diff-match-patch

Source

package.lisp (file)

Special Variable: *diff-timeout*

Number of seconds to refine a diff before giving up (NIL for infinity).

Package

diff-match-patch

Source

package.lisp (file)

Special Variable: *match-distance*

How far to search for a match (0 = exact location, 1000+ = broad match). A match this many characters away from the expected location will add 1.0 to the score (0.0 is a perfect match).

Package

diff-match-patch

Source

package.lisp (file)

Special Variable: *match-threshold*

At what point is no match declared (0.0 = perfection, 1.0 = very loose).

Package

diff-match-patch

Source

package.lisp (file)

Special Variable: *max-bits*

The number of bits in an int, used to limit the width of match patterns when applying an inexact patch. Common Lisp having bigints allows to set this value to NIL (meaning unlimited width), but keeping it as it is optimizes performance by using fixints only.

Package

diff-match-patch

Source

package.lisp (file)

Special Variable: *patch-delete-threshold*

When deleting a large block of text (over ~64 characters), how close do the contents have to be to match the expected contents. (0.0 = perfection, 1.0 = very loose). Note that *MATCH-THRESHOLD* controls how closely the end points of a delete need to match.

Package

diff-match-patch

Source

package.lisp (file)

Special Variable: *patch-margin*

Chunk size for context length.

Package

diff-match-patch

Source

package.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Functions

Function: apply-patch PATCH SEQ &key PADDING TEST

Apply PATCH (a list of hunks) to the sequence SEQ. Return two values: (1) SEQ, or its modified copy; and (2) a list of booleans, of the same length as PATCH, indicating for every hunk if it could be applied.

Package

diff-match-patch

Source

patch.lisp (file)

Function: diff A B &key TEST

Find the differences between two sequences A and B of elements comparable under the function TEST. Return a list of edit operations of the form (OP X), where OP is one of the keywords :+ :- :=, and X is a subsequence of A or B.

Package

diff-match-patch

Source

diff.lisp (file)

Function: diff-destination DIFFS

Given a difference list, rebuild the second of the compared sequences.

Package

diff-match-patch

Source

diff.lisp (file)

Function: diff-origin DIFFS

Given a difference list, rebuild the first of the compared sequences.

Package

diff-match-patch

Source

diff.lisp (file)

Function: index-abbreviator &optional HASH-TABLE-TEST

Return two unary functions: one to abbreviate things to integers, the other to restore them from integer abbreviations.

Package

diff-match-patch

Source

diff.lisp (file)

Function: levenshtein DIFFS

Given the difference list DIFFS between two sequences, return the corresponding Levenshtein distance.

Package

diff-match-patch

Source

diff.lisp (file)

Function: make-patch &rest ARGS

When called with two seuqences A and B, compute the diff between them and convert it into a list of hunk objects. Alternatively, the diff can be passed explicitly by keyword argument, and sequences reconstructed from it.

Package

diff-match-patch

Source

patch.lisp (file)

Function: mapdiff FN DIFFS

Return a copy of edit operation list DIFFS in which the content of every operation has been replaced by its image under FN.

Package

diff-match-patch

Source

diff.lisp (file)

Function: match SPACE PATTERN POSITION &key TEST

Locate a subsequence most closely resembling PATTERN in SPACE near POSITION.

Package

diff-match-patch

Source

match.lisp (file)

Function: read-chars-patch &optional IN

Read a formatted representation of patch encoding a difference of character strings from the stream IN and return it as a list of hunks.

Package

diff-match-patch

Source

patch.lisp (file)

Function: read-lines-patch &optional IN SEQ-TYPE

Read a formatted representation of patch encoding a difference of line sequences from the stream IN and return it as a list of hunks.

Package

diff-match-patch

Source

patch.lisp (file)

Function: translate-position DIFFS POSITION

Given the difference list DIFFS between two sequences and a POSITION in the first sequence, return the equivalent position in the second sequence.

Package

diff-match-patch

Source

diff.lisp (file)

Function: write-chars-patch PATCH &optional OUT

Write the formatted representation of the given PATCH (a hunk or list of hunks, encoding a difference of character strings) to the stream OUT.

Package

diff-match-patch

Source

patch.lisp (file)

Function: write-lines-patch PATCH &optional OUT

Write the formatted representation of the given PATCH (a hunk or list of hunks, encoding a difference of line sequences) to the stream OUT.

Package

diff-match-patch

Source

patch.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Generic functions

Generic Function: hunk-diffs OBJECT
Generic Function: (setf hunk-diffs) NEW-VALUE OBJECT
Package

diff-match-patch

Methods
Method: hunk-diffs (HUNK hunk)

automatically generated reader method

Source

patch.lisp (file)

Method: (setf hunk-diffs) NEW-VALUE (HUNK hunk)

automatically generated writer method

Source

patch.lisp (file)

Generic Function: hunk-length-a OBJECT
Generic Function: (setf hunk-length-a) NEW-VALUE OBJECT
Package

diff-match-patch

Methods
Method: hunk-length-a (HUNK hunk)

automatically generated reader method

Source

patch.lisp (file)

Method: (setf hunk-length-a) NEW-VALUE (HUNK hunk)

automatically generated writer method

Source

patch.lisp (file)

Generic Function: hunk-length-b OBJECT
Generic Function: (setf hunk-length-b) NEW-VALUE OBJECT
Package

diff-match-patch

Methods
Method: hunk-length-b (HUNK hunk)

automatically generated reader method

Source

patch.lisp (file)

Method: (setf hunk-length-b) NEW-VALUE (HUNK hunk)

automatically generated writer method

Source

patch.lisp (file)

Generic Function: hunk-start-a OBJECT
Generic Function: (setf hunk-start-a) NEW-VALUE OBJECT
Package

diff-match-patch

Methods
Method: hunk-start-a (HUNK hunk)

automatically generated reader method

Source

patch.lisp (file)

Method: (setf hunk-start-a) NEW-VALUE (HUNK hunk)

automatically generated writer method

Source

patch.lisp (file)

Generic Function: hunk-start-b OBJECT
Generic Function: (setf hunk-start-b) NEW-VALUE OBJECT
Package

diff-match-patch

Methods
Method: hunk-start-b (HUNK hunk)

automatically generated reader method

Source

patch.lisp (file)

Method: (setf hunk-start-b) NEW-VALUE (HUNK hunk)

automatically generated writer method

Source

patch.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.4 Classes

Class: hunk ()

A wrapper for an edit or group of adjacent edits.

Package

diff-match-patch

Source

patch.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: diffs
Type

list

Initargs

:diffs

Readers

hunk-diffs (generic function)

Writers

(setf hunk-diffs) (generic function)

Slot: start-a
Type

(integer 0)

Initargs

:start-a

Readers

hunk-start-a (generic function)

Writers

(setf hunk-start-a) (generic function)

Slot: start-b
Type

(integer 0)

Initargs

:start-b

Readers

hunk-start-b (generic function)

Writers

(setf hunk-start-b) (generic function)

Slot: length-a
Type

(integer 0)

Initargs

:length-a

Readers

hunk-length-a (generic function)

Writers

(setf hunk-length-a) (generic function)

Slot: length-b
Type

(integer 0)

Initargs

:length-b

Readers

hunk-length-b (generic function)

Writers

(setf hunk-length-b) (generic function)


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

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Special variables

Special Variable: %diff-deadline%
Package

diff-match-patch

Source

diff.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Macros

Macro: dlet* BINDINGS &body BODY
Package

diff-match-patch

Source

lib.lisp (file)

Macro: with-diff-deadline (&optional TIMEOUT) &body BODY
Package

diff-match-patch

Source

diff.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Functions

Function: add-padding PATCH PADDING

Return a copy of PATCH with PADDING added to its first and last hunk.

Package

diff-match-patch

Source

patch.lisp (file)

Function: affix-match A B TEST

If A and B are elementwise equal, return either of them. Otherwise, return four values: (1) the common prefix of A and B; (2, 3) the middle parts of A and B between the common prefix and the common suffix; and (4) the common suffix.

Package

diff-match-patch

Source

diff.lisp (file)

Function: apply-hunk HUNK SEQ DELTA TEST

Apply one HUNK to the sequence SEQ with an offset DELTA between expected and actual position. Return three values: (1) a boolean indicating if the hunk could be applied; (2) SEQ, or its modified copy; and (3) DELTA, possibly modified.

Package

diff-match-patch

Source

patch.lisp (file)

Function: cleanup-for-efficiency DIFFS TEST

Reduce the number of edits by eliminating operationally trivial equalities.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-merge DIFFS TEST

Reorder and merge like edit sections in the list DIFFS. Merge equalities. Any edit section can move as long as it doesn’t cross an equality.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-merge.join-differences DIFFS TEST

For every run of differences in the list DIFFS (separated by equalities), concatenate additions with additions and deletions with deletions to get two sequences, and factor out their common affixes, joining them unto the surrounding equalities.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-merge.shift-differences DIFFS TEST

For every unpaired edit in the list DIFFS which is surrounded by equalities on both sides, try to eliminate either the left or the right equality by “shifting through” the edit. E. g. =A -BA =C is equivalent to -AB =AC, =A -BC =B is equivalent to =AB -CB.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-semantic DIFFS TEST

Reduce the number of edits by eliminating semantically trivial equalities.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-semantic.boundary-score STR POS &key START END

Compute a score from 6 to 0 determining to which extent the position POS in the portion of STR between START and END is a logical boundary.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-semantic.eliminate-overlaps DIFFS TEST

Find overlaps between adjacent deletions and insertions in DIFFS and extract them by inserting equalities, provided the overlap is as big as the remainder of the edits. E. g. -ABCXXX +XXXDEF is the same as -ABC =XXX +DEF; -XXXABC +DEFXXX is the same as +DEF =XXX -ABC.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-semantic.eliminate-short-equalities DIFFS

Eliminate every equality in DIFFS which is no longer than either all the deletions or all the insertions on its left side, and ditto for those on its right side, by replacing it with a delete-add pair.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-semantic.next-short-equality DIFFS PREV-EQUALITIES

Find the first equality in DIFFS which is no longer than either all the deletions or all the insertions on its left side, and ditto for those on its right side. Return two values: (1) a three-element list, with (1a) differences on the left of the equality in reverse order, (1b) the content of the equality, and (1c) differences on the right in direct order; and (2) the list PREV-EQUALITIES unto which have been consed similar three-element lists representing equalities in DIFF before the one we’d found.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: cleanup-semantic.shift-lossless DIFFS TEST

For every unpaired edit in the list DIFFS which is surrounded by equalities on both sides, try to realign the edit by “shifting it through” to a logical boundary.

Package

diff-match-patch

Source

cleanup.lisp (file)

Function: copy-hunk HUNK &optional DIFFS START-A START-B LENGTH-A LENGTH-B

Return a copy of HUNK with zero or more slot values replaced by arguments.

Package

diff-match-patch

Source

patch.lisp (file)

Function: diff-bisect A B TEST

Use E. Myers’ (1986) algorithm to find the “middle snake” (equality) of an optimal diff of A and B, split the sequences just beyond the snake, and return four values: the two parts of A and the two parts of B. If the timeout is hit, or if the two sequences have no common elements, return NIL.

Package

diff-match-patch

Source

diff.lisp (file)

Function: diff-coerce DIFFS TYPE

Coerce the sequences in the elements of DIFFS to TYPE.

Package

diff-match-patch

Source

diff.lisp (file)

Function: diff-compute A B TEST

Find the differences between two sequences A and B of elements comparable under TEST, assuming that they don’t share a common preffix or suffix and that neither is empty.

Package

diff-match-patch

Source

diff.lisp (file)

Function: diff-line-mode A B TEST

Find the differences between the multiline texts A and B by comparing them as sequences of lines, then recursively comparing just the non-matching line runs by the general method.

Package

diff-match-patch

Source

diff.lisp (file)

Function: diff-seq-type DIFFS

Return the type of sequences in the elements of DIFFS.

Package

diff-match-patch

Source

diff.lisp (file)

Function: edits-xor DELS ADDS
Package

diff-match-patch

Source

cleanup.lisp (file)

Function: empty X
Package

diff-match-patch

Source

lib.lisp (file)

Function: filter-diffs DIFFS
Package

diff-match-patch

Source

cleanup.lisp (file)

Function: fn-to-hash-table-test FN
Package

diff-match-patch

Source

lib.lisp (file)

Function: format-hunk-header HUNK OUT
Package

diff-match-patch

Source

patch.lisp (file)

Function: get-internal-seconds ()
Package

diff-match-patch

Source

lib.lisp (file)

Function: half-match A B TEST

If the sequences A and B share a common infix which is at least half the length of the longer sequence, return five values: (1, 2) the prefixes of A and B up to (3) the common middle, and (4, 5) the suffixes of A and B after it. Otherwise, return NIL.

Package

diff-match-patch

Source

diff.lisp (file)

Function: index I L
Package

diff-match-patch

Source

lib.lisp (file)

Function: join PARTS
Package

diff-match-patch

Source

lib.lisp (file)

Function: join* &rest PARTS
Package

diff-match-patch

Source

lib.lisp (file)

Function: long-short A B
Package

diff-match-patch

Source

lib.lisp (file)

Function: make-adjustable-vector &optional SIZE
Package

diff-match-patch

Source

lib.lisp (file)

Function: make-hunk DIFFS START-A START-B LENGTH-A LENGTH-B CONTEXT

Create a hunk instance, ensuring that it includes a unique context.

Package

diff-match-patch

Source

patch.lisp (file)

Function: make-patch.cleanup DIFFS TEST

Cleanup DIFFS based on their size and type of elements.

Package

diff-match-patch

Source

patch.lisp (file)

Function: make-patch.next-hunk DIFFS START-A START-B LEFT-CONTEXT RIGHT-CONTEXT

Extract the next patch hunk from DIFFS.

Package

diff-match-patch

Source

patch.lisp (file)

Function: mapcall FN MFN &optional PARTS
Package

diff-match-patch

Source

lib.lisp (file)

Function: match-bitap SPACE PATTERN POSITION TEST

Use the Bitap algorithm to locate the best instance of PATTERN in SPACE near POSITION.

Package

diff-match-patch

Source

match.lisp (file)

Function: match-bitap.alphabet PATTERN TEST

Compute the alphabet for the Bitap algorithm, as a hash table mapping elements of PATTERN to integer hashes.

Package

diff-match-patch

Source

match.lisp (file)

Function: narrow SEQ START &optional END
Package

diff-match-patch

Source

lib.lisp (file)

Function: newline-char-p C
Package

diff-match-patch

Source

lib.lisp (file)

Function: next-diffs DIFFS

Extract all differences from the beginning of the list DIFFS, up to the first equality or the end of the list, whichever comes first. Return four values: (1) the concatenation of all deleted sequences, (2) the concatenation of all added sequences, (3) the equal sequence (or NIL if the end of DIFFS was reached), and (4) the rest of DIFFS after the equality.

Package

diff-match-patch

Source

diff.lisp (file)

Function: overlap A B &optional TEST
Package

diff-match-patch

Source

lib.lisp (file)

Function: parse-hunk-header IN
Package

diff-match-patch

Source

patch.lisp (file)

Function: past-diff-deadline ()
Package

diff-match-patch

Source

diff.lisp (file)

Function: prefixp A B &optional TEST
Package

diff-match-patch

Source

lib.lisp (file)

Function: read-char-urldecode IN
Package

diff-match-patch

Source

lib.lisp (file)

Function: read-line-urldecode IN
Package

diff-match-patch

Source

lib.lisp (file)

Function: revappend* X &rest YY
Package

diff-match-patch

Source

lib.lisp (file)

Function: seq-type X
Package

diff-match-patch

Source

lib.lisp (file)

Function: split-at SEQ POSITION &optional POSITION2 DROP-MIDDLE
Package

diff-match-patch

Source

lib.lisp (file)

Function: split-big-hunk HUNK SIZE

Split HUNK into pieces not exceeding SIZE and return them as a list of hunks.

Package

diff-match-patch

Source

patch.lisp (file)

Function: split-big-hunks PATCH

Return a copy of PATCH with all big hunks split. (Big hunks are hunks whose length exceeds the maximum limit of the match algorithm.)

Package

diff-match-patch

Source

patch.lisp (file)

Function: split-lines STR
Package

diff-match-patch

Source

lib.lisp (file)

Function: suffixp A B &optional TEST
Package

diff-match-patch

Source

lib.lisp (file)

Function: trivial-padding PATCH LENGTH

Return a padding sequence for PATCH, of the given LENGTH.

Package

diff-match-patch

Source

patch.lisp (file)

Function: whitespace-char-p C
Package

diff-match-patch

Source

lib.lisp (file)

Function: write-char-urlencode C OUT
Package

diff-match-patch

Source

lib.lisp (file)

Function: write-line-urlencode LINE OUT
Package

diff-match-patch

Source

lib.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   D   F   L   M  
Index Entry  Section

D
diff-match-patch.asd: The diff-match-patch<dot>asd file
diff-match-patch/src: The diff-match-patch/src module
diff-match-patch/src/cleanup.lisp: The diff-match-patch/src/cleanup<dot>lisp file
diff-match-patch/src/diff.lisp: The diff-match-patch/src/diff<dot>lisp file
diff-match-patch/src/lib.lisp: The diff-match-patch/src/lib<dot>lisp file
diff-match-patch/src/match.lisp: The diff-match-patch/src/match<dot>lisp file
diff-match-patch/src/package.lisp: The diff-match-patch/src/package<dot>lisp file
diff-match-patch/src/patch.lisp: The diff-match-patch/src/patch<dot>lisp file

F
File, Lisp, diff-match-patch.asd: The diff-match-patch<dot>asd file
File, Lisp, diff-match-patch/src/cleanup.lisp: The diff-match-patch/src/cleanup<dot>lisp file
File, Lisp, diff-match-patch/src/diff.lisp: The diff-match-patch/src/diff<dot>lisp file
File, Lisp, diff-match-patch/src/lib.lisp: The diff-match-patch/src/lib<dot>lisp file
File, Lisp, diff-match-patch/src/match.lisp: The diff-match-patch/src/match<dot>lisp file
File, Lisp, diff-match-patch/src/package.lisp: The diff-match-patch/src/package<dot>lisp file
File, Lisp, diff-match-patch/src/patch.lisp: The diff-match-patch/src/patch<dot>lisp file

L
Lisp File, diff-match-patch.asd: The diff-match-patch<dot>asd file
Lisp File, diff-match-patch/src/cleanup.lisp: The diff-match-patch/src/cleanup<dot>lisp file
Lisp File, diff-match-patch/src/diff.lisp: The diff-match-patch/src/diff<dot>lisp file
Lisp File, diff-match-patch/src/lib.lisp: The diff-match-patch/src/lib<dot>lisp file
Lisp File, diff-match-patch/src/match.lisp: The diff-match-patch/src/match<dot>lisp file
Lisp File, diff-match-patch/src/package.lisp: The diff-match-patch/src/package<dot>lisp file
Lisp File, diff-match-patch/src/patch.lisp: The diff-match-patch/src/patch<dot>lisp file

M
Module, diff-match-patch/src: The diff-match-patch/src module

Jump to:   D   F   L   M  

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

A.2 Functions

Jump to:   (  
A   C   D   E   F   G   H   I   J   L   M   N   O   P   R   S   T   W  
Index Entry  Section

(
(setf hunk-diffs): Exported generic functions
(setf hunk-diffs): Exported generic functions
(setf hunk-length-a): Exported generic functions
(setf hunk-length-a): Exported generic functions
(setf hunk-length-b): Exported generic functions
(setf hunk-length-b): Exported generic functions
(setf hunk-start-a): Exported generic functions
(setf hunk-start-a): Exported generic functions
(setf hunk-start-b): Exported generic functions
(setf hunk-start-b): Exported generic functions

A
add-padding: Internal functions
affix-match: Internal functions
apply-hunk: Internal functions
apply-patch: Exported functions

C
cleanup-for-efficiency: Internal functions
cleanup-merge: Internal functions
cleanup-merge.join-differences: Internal functions
cleanup-merge.shift-differences: Internal functions
cleanup-semantic: Internal functions
cleanup-semantic.boundary-score: Internal functions
cleanup-semantic.eliminate-overlaps: Internal functions
cleanup-semantic.eliminate-short-equalities: Internal functions
cleanup-semantic.next-short-equality: Internal functions
cleanup-semantic.shift-lossless: Internal functions
copy-hunk: Internal functions

D
diff: Exported functions
diff-bisect: Internal functions
diff-coerce: Internal functions
diff-compute: Internal functions
diff-destination: Exported functions
diff-line-mode: Internal functions
diff-origin: Exported functions
diff-seq-type: Internal functions
dlet*: Internal macros

E
edits-xor: Internal functions
empty: Internal functions

F
filter-diffs: Internal functions
fn-to-hash-table-test: Internal functions
format-hunk-header: Internal functions
Function, add-padding: Internal functions
Function, affix-match: Internal functions
Function, apply-hunk: Internal functions
Function, apply-patch: Exported functions
Function, cleanup-for-efficiency: Internal functions
Function, cleanup-merge: Internal functions
Function, cleanup-merge.join-differences: Internal functions
Function, cleanup-merge.shift-differences: Internal functions
Function, cleanup-semantic: Internal functions
Function, cleanup-semantic.boundary-score: Internal functions
Function, cleanup-semantic.eliminate-overlaps: Internal functions
Function, cleanup-semantic.eliminate-short-equalities: Internal functions
Function, cleanup-semantic.next-short-equality: Internal functions
Function, cleanup-semantic.shift-lossless: Internal functions
Function, copy-hunk: Internal functions
Function, diff: Exported functions
Function, diff-bisect: Internal functions
Function, diff-coerce: Internal functions
Function, diff-compute: Internal functions
Function, diff-destination: Exported functions
Function, diff-line-mode: Internal functions
Function, diff-origin: Exported functions
Function, diff-seq-type: Internal functions
Function, edits-xor: Internal functions
Function, empty: Internal functions
Function, filter-diffs: Internal functions
Function, fn-to-hash-table-test: Internal functions
Function, format-hunk-header: Internal functions
Function, get-internal-seconds: Internal functions
Function, half-match: Internal functions
Function, index: Internal functions
Function, index-abbreviator: Exported functions
Function, join: Internal functions
Function, join*: Internal functions
Function, levenshtein: Exported functions
Function, long-short: Internal functions
Function, make-adjustable-vector: Internal functions
Function, make-hunk: Internal functions
Function, make-patch: Exported functions
Function, make-patch.cleanup: Internal functions
Function, make-patch.next-hunk: Internal functions
Function, mapcall: Internal functions
Function, mapdiff: Exported functions
Function, match: Exported functions
Function, match-bitap: Internal functions
Function, match-bitap.alphabet: Internal functions
Function, narrow: Internal functions
Function, newline-char-p: Internal functions
Function, next-diffs: Internal functions
Function, overlap: Internal functions
Function, parse-hunk-header: Internal functions
Function, past-diff-deadline: Internal functions
Function, prefixp: Internal functions
Function, read-char-urldecode: Internal functions
Function, read-chars-patch: Exported functions
Function, read-line-urldecode: Internal functions
Function, read-lines-patch: Exported functions
Function, revappend*: Internal functions
Function, seq-type: Internal functions
Function, split-at: Internal functions
Function, split-big-hunk: Internal functions
Function, split-big-hunks: Internal functions
Function, split-lines: Internal functions
Function, suffixp: Internal functions
Function, translate-position: Exported functions
Function, trivial-padding: Internal functions
Function, whitespace-char-p: Internal functions
Function, write-char-urlencode: Internal functions
Function, write-chars-patch: Exported functions
Function, write-line-urlencode: Internal functions
Function, write-lines-patch: Exported functions

G
Generic Function, (setf hunk-diffs): Exported generic functions
Generic Function, (setf hunk-length-a): Exported generic functions
Generic Function, (setf hunk-length-b): Exported generic functions
Generic Function, (setf hunk-start-a): Exported generic functions
Generic Function, (setf hunk-start-b): Exported generic functions
Generic Function, hunk-diffs: Exported generic functions
Generic Function, hunk-length-a: Exported generic functions
Generic Function, hunk-length-b: Exported generic functions
Generic Function, hunk-start-a: Exported generic functions
Generic Function, hunk-start-b: Exported generic functions
get-internal-seconds: Internal functions

H
half-match: Internal functions
hunk-diffs: Exported generic functions
hunk-diffs: Exported generic functions
hunk-length-a: Exported generic functions
hunk-length-a: Exported generic functions
hunk-length-b: Exported generic functions
hunk-length-b: Exported generic functions
hunk-start-a: Exported generic functions
hunk-start-a: Exported generic functions
hunk-start-b: Exported generic functions
hunk-start-b: Exported generic functions

I
index: Internal functions
index-abbreviator: Exported functions

J
join: Internal functions
join*: Internal functions

L
levenshtein: Exported functions
long-short: Internal functions

M
Macro, dlet*: Internal macros
Macro, with-diff-deadline: Internal macros
make-adjustable-vector: Internal functions
make-hunk: Internal functions
make-patch: Exported functions
make-patch.cleanup: Internal functions
make-patch.next-hunk: Internal functions
mapcall: Internal functions
mapdiff: Exported functions
match: Exported functions
match-bitap: Internal functions
match-bitap.alphabet: Internal functions
Method, (setf hunk-diffs): Exported generic functions
Method, (setf hunk-length-a): Exported generic functions
Method, (setf hunk-length-b): Exported generic functions
Method, (setf hunk-start-a): Exported generic functions
Method, (setf hunk-start-b): Exported generic functions
Method, hunk-diffs: Exported generic functions
Method, hunk-length-a: Exported generic functions
Method, hunk-length-b: Exported generic functions
Method, hunk-start-a: Exported generic functions
Method, hunk-start-b: Exported generic functions

N
narrow: Internal functions
newline-char-p: Internal functions
next-diffs: Internal functions

O
overlap: Internal functions

P
parse-hunk-header: Internal functions
past-diff-deadline: Internal functions
prefixp: Internal functions

R
read-char-urldecode: Internal functions
read-chars-patch: Exported functions
read-line-urldecode: Internal functions
read-lines-patch: Exported functions
revappend*: Internal functions

S
seq-type: Internal functions
split-at: Internal functions
split-big-hunk: Internal functions
split-big-hunks: Internal functions
split-lines: Internal functions
suffixp: Internal functions

T
translate-position: Exported functions
trivial-padding: Internal functions

W
whitespace-char-p: Internal functions
with-diff-deadline: Internal macros
write-char-urlencode: Internal functions
write-chars-patch: Exported functions
write-line-urlencode: Internal functions
write-lines-patch: Exported functions

Jump to:   (  
A   C   D   E   F   G   H   I   J   L   M   N   O   P   R   S   T   W  

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

A.3 Variables

Jump to:   %   *  
D   L   S  
Index Entry  Section

%
%diff-deadline%: Internal special variables

*
*diff-check-lines-length*: Exported special variables
*diff-edit-cost*: Exported special variables
*diff-timeout*: Exported special variables
*match-distance*: Exported special variables
*match-threshold*: Exported special variables
*max-bits*: Exported special variables
*patch-delete-threshold*: Exported special variables
*patch-margin*: Exported special variables

D
diffs: Exported classes

L
length-a: Exported classes
length-b: Exported classes

S
Slot, diffs: Exported classes
Slot, length-a: Exported classes
Slot, length-b: Exported classes
Slot, start-a: Exported classes
Slot, start-b: Exported classes
Special Variable, %diff-deadline%: Internal special variables
Special Variable, *diff-check-lines-length*: Exported special variables
Special Variable, *diff-edit-cost*: Exported special variables
Special Variable, *diff-timeout*: Exported special variables
Special Variable, *match-distance*: Exported special variables
Special Variable, *match-threshold*: Exported special variables
Special Variable, *max-bits*: Exported special variables
Special Variable, *patch-delete-threshold*: Exported special variables
Special Variable, *patch-margin*: Exported special variables
start-a: Exported classes
start-b: Exported classes

Jump to:   %   *  
D   L   S  

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

A.4 Data types

Jump to:   C   D   H   P   S  
Index Entry  Section

C
Class, hunk: Exported classes

D
diff-match-patch: The diff-match-patch system
diff-match-patch: The diff-match-patch package
dmp-system: The dmp-system package

H
hunk: Exported classes

P
Package, diff-match-patch: The diff-match-patch package
Package, dmp-system: The dmp-system package

S
System, diff-match-patch: The diff-match-patch system

Jump to:   C   D   H   P   S