package ecaml

  1. Overview
  2. Docs
Library for writing Emacs plugin in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=87e76473915e12d718096100a5c4d15d98aba6f99ecbf21814b7389e8c28bb25

doc/ecaml/Ecaml/Thing_at_point/index.html

Module Ecaml.Thing_at_pointSource

Support for detecting something at point---a filename, URL, what-have-you.

Sourcetype t =
  1. | Defun
  2. | Email
  3. | Filename
  4. | Line
  5. | List
  6. | Number
    (*

    Any other "thing" supported by thing-at-point. Use defthing to register a new thing type.

    *)
  7. | Other of Symbol.t
  8. | Page
  9. | Sentence
  10. | Sexp
    (*

    Any string containing only characters in chars, which is a regexp character alternative (i.e. a string that would go between square brackets in a regexp).

    *)
  11. | String_of of {
    1. chars : string;
    }
  12. | Symbol
  13. | Url
  14. | Whitespace
  15. | Word
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval find : ?text_properties:bool -> t -> Text.t option

Find the given kind of thing at point, if any. If text_properties is false, text properties are stripped from the returned string.

(describe-function 'thing-at-point)

Sourceval forward : ?n:int -> t -> bool

(describe-function 'forward-thing)

NOTE: Many thing types, including Other and several built-in types, don't support forward.

Sourceval bounds : t -> (Position.t * Position.t) option

(describe-function 'bounds-of-thing-at-point)

Sourceval beginning_exn : t -> unit

(describe-function 'beginning-of-thing)

Sourceval beginning : t -> bool

beginning tries beginning_exn and returns false if it would have raised.

Sourceval end_exn : t -> unit

(describe-function 'end-of-thing)

Sourceval end_ : t -> bool

end_ tries end_exn and returns false if it would have raised.

Sourceval defthing : Symbol.t -> Core.Source_code_position.t -> bounds:(unit -> (Position.t * Position.t) option) -> t

Define symbol as a "thing" so that Other symbol works as the argument to find, etc (but not forward). The effect is to define a property of the symbol; so long as that property isn't otherwise used, the symbol can be used for other purposes as well.

OCaml

Innovation. Community. Security.