gnu.jemacs.buffer

Class Buffer

public abstract class Buffer extends AbstractSequence implements CharSeq

Field Summary
EKeymap[]activeKeymaps
static Hashtablebuffers
Map buffer names to buffers.
static HashtablefileBuffers
Map file names to buffer.s
MarkermarkMarker
MarkerpointMarker
Constructor Summary
Buffer(String name)
Method Summary
voidbackwardChar(int i)
charcharAt(int index)
intcharWidth(char ch, int column)
intcheckMark()
static BuffercoerceBuffer(Object buf)
voidconsume(int start, int count, Consumer out)
intcountColumns(char[] chars, int start, int count, int initial)
intcurrentColumn()
intcurrentColumn(int offset)
Return the column number at a specified offset.
EWindowdisplay(boolean notThisWindow, EFrame frame)
voidfill(char value)
voidfill(int fromIndex, int toIndex, char value)
static BufferfindFile(String fname)
voidforwardChar(int i)
longforwardLine(int lines, int start)
Find the position a give number of lines forward or backward.
intforwardLine(int lines)
static StringgenerateNewBufferName(String start)
static BuffergetBuffer(String name)
voidgetChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
static BuffergetCurrent()
intgetDot()
StringgetFileName()
abstract intgetLength()
EKeymapgetLocalKeymap()
MarkergetMarkMarker(boolean force)
StringgetName()
PathgetPath()
intgetPoint()
MarkergetPointMarker(boolean share)
abstract CharSeqgetStringContent()
abstract voidinsert(String string, Object style, int ipos)
Insert string with given style at position pair.
voidinsert(char[] chars, int offset, int count, Object style, int ipos)
Insert character with given style at position pair.
voidinsert(String string, Object style)
voidinsert(Object value, Object style)
voidinsert(char ch, int count)
Insert count copies of ch at point.
voidinsert(char ch, int count, Object style)
Insert count copies of ch at point.
voidinsertAll(Object[] values, Object style)
abstract voidinsertFile(Reader in)
voidinsertFile(String filename)
abstract voidinvoke(Runnable doRun)
This is intended for Runnable's that may affect the state of the buffer.
intlength()
abstract intlineStartOffset(int offset)
intlineStartOffset()
static voidmakeBufferLocal(Object symbol, boolean all)
abstract intmaxDot()
intminDot()
intmoveToColumn(int column, boolean force)
abstract InPortopenReader(int start, int count)
intpositionToOffset(Object position)
Convert an Emacs position (Marker, or 1-origin integer) to a (0-origin) buffer offset.
abstract voidredrawModeline()
abstract voidremoveAll()
voidremoveChar(int count)
abstract voidrestorePointMark(long pointMark)
abstract voidsave(Writer out)
voidsave()
abstract longsavePointMark()
abstract longscan(char target, int start, int end, int count, boolean allowQuit)
Search in BUF for COUNT instances of the character TARGET between START and END.
voidsetCharAt(int index, char ch)
static voidsetCurrent(Buffer buffer)
voidsetDot(int i)
voidsetFileName(String fname)
voidsetLocalKeymap(EKeymap map)
voidsetPath(Path path)
voidsetPoint(int i)
CharSequencesubSequence(int start, int end)
StringtoString()
voidwriteTo(int start, int count, Writer dest)
voidwriteTo(Writer str)

Field Detail

activeKeymaps

public EKeymap[] activeKeymaps

buffers

public static Hashtable buffers
Map buffer names to buffers.

fileBuffers

public static Hashtable fileBuffers
Map file names to buffer.s

markMarker

public Marker markMarker

pointMarker

public Marker pointMarker

Constructor Detail

Buffer

public Buffer(String name)

Method Detail

backwardChar

public void backwardChar(int i)

charAt

public char charAt(int index)

See Also: CharSeq

charWidth

public int charWidth(char ch, int column)

checkMark

public int checkMark()

coerceBuffer

public static Buffer coerceBuffer(Object buf)

consume

public void consume(int start, int count, Consumer out)

See Also: CharSeq

countColumns

public int countColumns(char[] chars, int start, int count, int initial)

currentColumn

public int currentColumn()

currentColumn

public int currentColumn(int offset)
Return the column number at a specified offset.

display

public EWindow display(boolean notThisWindow, EFrame frame)

fill

public void fill(char value)

See Also: CharSeq

fill

public void fill(int fromIndex, int toIndex, char value)

See Also: CharSeq

findFile

public static Buffer findFile(String fname)

forwardChar

public void forwardChar(int i)

forwardLine

public final long forwardLine(int lines, int start)
Find the position a give number of lines forward or backward. A side-effect-free version of Emacs's forward-line function.

Parameters: lines number of lines forward (or backward if negative) start initial position (buffer offset)

Returns: (SHORTAGE<<32|POS)

forwardLine

public int forwardLine(int lines)

generateNewBufferName

public static String generateNewBufferName(String start)

getBuffer

public static Buffer getBuffer(String name)

getChars

public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)

See Also: (int, int, char[], int)

getCurrent

public static Buffer getCurrent()

getDot

public int getDot()

getFileName

public String getFileName()

getLength

public abstract int getLength()

getLocalKeymap

public EKeymap getLocalKeymap()

getMarkMarker

public Marker getMarkMarker(boolean force)

getName

public String getName()

getPath

public Path getPath()

getPoint

public int getPoint()

getPointMarker

public Marker getPointMarker(boolean share)

getStringContent

public abstract CharSeq getStringContent()

insert

public abstract void insert(String string, Object style, int ipos)
Insert string with given style at position pair.

insert

public void insert(char[] chars, int offset, int count, Object style, int ipos)
Insert character with given style at position pair.

insert

public void insert(String string, Object style)

insert

public void insert(Object value, Object style)

insert

public void insert(char ch, int count)
Insert count copies of ch at point.

insert

public void insert(char ch, int count, Object style)
Insert count copies of ch at point.

insertAll

public void insertAll(Object[] values, Object style)

insertFile

public abstract void insertFile(Reader in)

insertFile

public void insertFile(String filename)

invoke

public abstract void invoke(Runnable doRun)
This is intended for Runnable's that may affect the state of the buffer. The implementation should make shure that the GUI is properly updated before control returns

Parameters: doRun

length

public final int length()

lineStartOffset

public abstract int lineStartOffset(int offset)

lineStartOffset

public int lineStartOffset()

makeBufferLocal

public static void makeBufferLocal(Object symbol, boolean all)

Parameters: all true if make-variable-buffer-local, false if make-local-variable FIXME

maxDot

public abstract int maxDot()

minDot

public int minDot()

moveToColumn

public int moveToColumn(int column, boolean force)

openReader

public abstract InPort openReader(int start, int count)

positionToOffset

public int positionToOffset(Object position)
Convert an Emacs position (Marker, or 1-origin integer) to a (0-origin) buffer offset.

redrawModeline

public abstract void redrawModeline()

removeAll

public abstract void removeAll()

removeChar

public void removeChar(int count)

restorePointMark

public abstract void restorePointMark(long pointMark)

save

public abstract void save(Writer out)

save

public void save()

savePointMark

public abstract long savePointMark()

scan

public abstract long scan(char target, int start, int end, int count, boolean allowQuit)
Search in BUF for COUNT instances of the character TARGET between START and END. If COUNT is positive, search forwards; END must be >= START. If COUNT is negative, search backwards for the -COUNTth instance; END must be <= START. If COUNT is zero, do anything you please; run rogue, for all I care. If END is zero, use beginning or end of (FIXME: accessible part of) the buffer, as appropriate for the direction indicated by COUNT. If we find COUNT instances, SHORTAGE is zero, and return the position after the COUNTth match. Note that for reverse motion this is not the same as the usual convention for Emacs motion commands. If we don't find COUNT instances before reaching END, set SHORTAGE to the number of TARGETs left unfound, and return (shortage<<32|END).

Returns: (SHORTAGE<<32|POS)

setCharAt

public void setCharAt(int index, char ch)

See Also: CharSeq

setCurrent

public static void setCurrent(Buffer buffer)

setDot

public void setDot(int i)

setFileName

public void setFileName(String fname)

setLocalKeymap

public void setLocalKeymap(EKeymap map)

setPath

public void setPath(Path path)

setPoint

public final void setPoint(int i)

subSequence

public CharSequence subSequence(int start, int end)

toString

public String toString()

writeTo

public void writeTo(int start, int count, Writer dest)

See Also: CharSeq

writeTo

public void writeTo(Writer str)