Package eu.bandm.tools.location
Class LocationStyles
java.lang.Object
eu.bandm.tools.location.LocationStyles
Different styles of location usage. Contains static definitions only.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The number given by emacs to the first column.static final int
The number given by emacs to the first line.Formats the location with the default "toString()" for the document identifier.static final int
The number requried by the GNU standard to start the column numbers.static final int
The number requried by the GNU standard to start the line numbers.static final int
Invalid line number, used only in the printing routine to indicate that the point's line number is never a repetition. -
Method Summary
-
Field Details
-
EMACS_FIRST_LINE_NUMBER
public static final int EMACS_FIRST_LINE_NUMBERThe number given by emacs to the first line. Refers to GNU Emacs 27.1. "Line 1 is the beginning of the buffer." says the documentation f th "M-g g" command.- See Also:
-
EMACS_FIRST_COLUMN_NUMBER
public static final int EMACS_FIRST_COLUMN_NUMBERThe number given by emacs to the first column. Refers to GNU Emacs 27.1. "Column 0 is the leftmost column." says the documentation of the "M-g TAB ¶" command.- See Also:
-
NO_CONTEXT
public static final int NO_CONTEXTInvalid line number, used only in the printing routine to indicate that the point's line number is never a repetition.- See Also:
-
formatEmacs
Formats the location with the default "toString()" for the document identifier.- See Also:
-
GNU_FIRST_LINE_NUMBER
public static final int GNU_FIRST_LINE_NUMBERThe number requried by the GNU standard to start the line numbers. See invalid input: '<'a href="https://www.gnu.org/prep/standards/standards.html#Errors" GNU Coding Standards, section 4.4.- See Also:
-
GNU_FIRST_COLUMN_NUMBER
public static final int GNU_FIRST_COLUMN_NUMBERThe number requried by the GNU standard to start the column numbers. See invalid input: '<'a href="https://www.gnu.org/prep/standards/standards.html#Errors" GNU Coding Standards, section 4.4.- See Also:
-
-
Method Details
-
formatEmacs
public static <D> Function<Location<? extends D>,String> formatEmacs(Function<D, ? extends String> formatDoc) Convert to a String which is compatible with the emacs function "next-error". See GNU Coding Standards § 4.4, https://www.gnu.org/prep/standards/standards.html#ErrorsNumbers of lines and columns are separated by ".". Unkown values are represented by "?". Not applicable values are not printed. If present, the document id is printed first, followed by ":". Regions are printed by begin and end separated by "-". Line numbers are not repeated when they are identical.
- Type Parameters:
D
- a document type.- Parameters:
formatDoc
- to convert the document identifier into a printable String- Returns:
- the function which converts a location into a string.
-