Class LocationStyles

java.lang.Object
eu.bandm.tools.location.LocationStyles

public class LocationStyles extends Object
Different styles of location usage. Contains static definitions only.
  • Field Details

    • EMACS_FIRST_LINE_NUMBER

      public static final int EMACS_FIRST_LINE_NUMBER
      The 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_NUMBER
      The 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_CONTEXT
      Invalid line number, used only in the printing routine to indicate that the point's line number is never a repetition.
      See Also:
    • formatEmacs

      public static final Function<Location<?>,String> 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_NUMBER
      The 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_NUMBER
      The 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#Errors

      Numbers 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.