gnu.jemacs.buffer
Class Buffer
public abstract
class
Buffer
extends AbstractSequence
implements CharSeq
Method Summary |
void | backwardChar(int i) |
char | charAt(int index) |
int | charWidth(char ch, int column) |
int | checkMark() |
static Buffer | coerceBuffer(Object buf) |
void | consume(int start, int count, Consumer out) |
int | countColumns(char[] chars, int start, int count, int initial) |
int | currentColumn() |
int | currentColumn(int offset) Return the column number at a specified offset. |
EWindow | display(boolean notThisWindow, EFrame frame) |
void | fill(char value) |
void | fill(int fromIndex, int toIndex, char value) |
static Buffer | findFile(String fname) |
void | forwardChar(int i) |
long | forwardLine(int lines, int start) Find the position a give number of lines forward or backward.
|
int | forwardLine(int lines) |
static String | generateNewBufferName(String start) |
static Buffer | getBuffer(String name) |
void | getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) |
static Buffer | getCurrent() |
int | getDot() |
String | getFileName() |
abstract int | getLength() |
EKeymap | getLocalKeymap() |
Marker | getMarkMarker(boolean force) |
String | getName() |
Path | getPath() |
int | getPoint() |
Marker | getPointMarker(boolean share) |
abstract CharSeq | getStringContent() |
abstract void | insert(String string, Object style, int ipos) Insert string with given style at position pair. |
void | insert(char[] chars, int offset, int count, Object style, int ipos) Insert character with given style at position pair. |
void | insert(String string, Object style) |
void | insert(Object value, Object style) |
void | insert(char ch, int count) Insert count copies of ch at point. |
void | insert(char ch, int count, Object style) Insert count copies of ch at point. |
void | insertAll(Object[] values, Object style) |
abstract void | insertFile(Reader in) |
void | insertFile(String filename) |
abstract void | invoke(Runnable doRun)
This is intended for Runnable's that may affect the state of the buffer.
|
int | length() |
abstract int | lineStartOffset(int offset) |
int | lineStartOffset() |
static void | makeBufferLocal(Object symbol, boolean all) |
abstract int | maxDot() |
int | minDot() |
int | moveToColumn(int column, boolean force) |
abstract InPort | openReader(int start, int count) |
int | positionToOffset(Object position) Convert an Emacs position (Marker, or 1-origin integer)
to a (0-origin) buffer offset. |
abstract void | redrawModeline() |
abstract void | removeAll() |
void | removeChar(int count) |
abstract void | restorePointMark(long pointMark) |
abstract void | save(Writer out) |
void | save() |
abstract long | savePointMark() |
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.
|
void | setCharAt(int index, char ch) |
static void | setCurrent(Buffer buffer) |
void | setDot(int i) |
void | setFileName(String fname) |
void | setLocalKeymap(EKeymap map) |
void | setPath(Path path) |
void | setPoint(int i) |
CharSequence | subSequence(int start, int end) |
String | toString() |
void | writeTo(int start, int count, Writer dest) |
void | writeTo(Writer str) |
public static Hashtable buffers
Map buffer names to buffers.
public static Hashtable fileBuffers
Map file names to buffer.s
public Buffer(String name)
public void backwardChar(int i)
public char charAt(int index)
public int charWidth(char ch, int column)
public int checkMark()
public static
Buffer coerceBuffer(Object buf)
public void consume(int start, int count,
Consumer out)
public int countColumns(char[] chars, int start, int count, int initial)
public int currentColumn()
public int currentColumn(int offset)
Return the column number at a specified offset.
public void fill(char value)
public void fill(int fromIndex, int toIndex, char value)
public static
Buffer findFile(String fname)
public void forwardChar(int i)
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)
public int forwardLine(int lines)
public static String generateNewBufferName(String start)
public static
Buffer getBuffer(String name)
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
public static
Buffer getCurrent()
public int getDot()
public String getFileName()
public abstract int getLength()
public
Marker getMarkMarker(boolean force)
public String getName()
public int getPoint()
public
Marker getPointMarker(boolean share)
public abstract
CharSeq getStringContent()
public abstract void insert(String string, Object style, int ipos)
Insert string with given style at position pair.
public void insert(char[] chars, int offset, int count, Object style, int ipos)
Insert character with given style at position pair.
public void insert(String string, Object style)
public void insert(Object value, Object style)
public void insert(char ch, int count)
Insert count copies of ch at point.
public void insert(char ch, int count, Object style)
Insert count copies of ch at point.
public void insertAll(Object[] values, Object style)
public abstract void insertFile(Reader in)
public void insertFile(String filename)
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
public final int length()
public abstract int lineStartOffset(int offset)
public int lineStartOffset()
public static void makeBufferLocal(Object symbol, boolean all)
Parameters: all true if make-variable-buffer-local,
false if make-local-variable FIXME
public abstract int maxDot()
public int minDot()
public int moveToColumn(int column, boolean force)
public abstract
InPort openReader(int start, int count)
public int positionToOffset(Object position)
Convert an Emacs position (Marker, or 1-origin integer)
to a (0-origin) buffer offset.
public abstract void redrawModeline()
public abstract void removeAll()
public void removeChar(int count)
public abstract void restorePointMark(long pointMark)
public abstract void save(Writer out)
public void save()
public abstract long savePointMark()
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)
public void setCharAt(int index, char ch)
public static void setCurrent(
Buffer buffer)
public void setDot(int i)
public void setFileName(String fname)
public void setLocalKeymap(
EKeymap map)
public void setPath(
Path path)
public final void setPoint(int i)
public CharSequence subSequence(int start, int end)
public String toString()
public void writeTo(int start, int count, Writer dest)
public void writeTo(Writer str)