package ecaml
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=87e76473915e12d718096100a5c4d15d98aba6f99ecbf21814b7389e8c28bb25
doc/ecaml/Ecaml/Thing_at_point/index.html
Module Ecaml.Thing_at_point
Source
Support for detecting something at point---a filename, URL, what-have-you.
type t =
| Defun
| Email
| Filename
| Line
| List
| Number
(*Any other "thing" supported by
*)thing-at-point
. Usedefthing
to register a new thing type.| Other of Symbol.t
| Page
| Sentence
| 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).| String_of of {
}
| Symbol
| Url
| Whitespace
| Word
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)
(describe-function 'forward-thing)
NOTE: Many thing types, including Other
and several built-in types, don't support forward
.
(describe-function 'bounds-of-thing-at-point)
beginning
tries beginning_exn
and returns false if it would have raised.
val 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.