package ecaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A hook is a variable where you can store a function or functions to be called on a particular occasion by an existing program. Emacs provides hooks for the sake of customization.

Hooks installed through Ecaml are wrapped in an exception handler that prints the error to the *Messages* buffer and exits the function normally.

(Info-goto-node "(elisp)Hooks")

type ('a, 'b) t
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> ('b -> Sexplib0.Sexp.t) -> ('a, 'b) t -> Sexplib0.Sexp.t
type after_change = {
  1. beginning_of_changed_region : Position.t;
  2. end_of_changed_region : Position.t;
  3. length_before_change : int;
}
val sexp_of_after_change : after_change -> Sexplib0.Sexp.t
type before_change = {
  1. beginning_of_changed_region : Position.t;
  2. end_of_changed_region : Position.t;
}
val sexp_of_before_change : before_change -> Sexplib0.Sexp.t
type file = {
  1. file : string;
}
val sexp_of_file : file -> Sexplib0.Sexp.t
type normal = unit
val sexp_of_normal : normal -> Sexplib0.Sexp.t
type frame = {
  1. frame : Frame.t;
}
val sexp_of_frame : frame -> Sexplib0.Sexp.t
type window = {
  1. window : Window.t;
  2. start : Position.t;
}
val sexp_of_window : window -> Sexplib0.Sexp.t
module Hook_type : sig ... end
module Wrap : sig ... end
val var : (_, _) t -> Ecaml_value.Function.t list Var.t
module Where : sig ... end
module Function : sig ... end
val add : ?buffer_local:bool -> ?one_shot:bool -> ?where:Where.t -> ('a, 'b) t -> ('a, 'b) Function.t -> unit

(describe-function 'add-hook) (Info-goto-node "(elisp)Setting Hooks")

If one_shot is true, the hook will be removed after the first time it runs.

val remove : ?buffer_local:bool -> ('a, 'b) t -> ('a, 'b) Function.t -> unit

(describe-function 'remove-hook) (Info-goto-node "(elisp)Setting Hooks")

val remove_symbol : ?buffer_local:bool -> ('a, 'b) t -> Symbol.t -> unit
val clear : (_, _) t -> unit
val run : (normal, unit) t -> unit Async_kernel.Deferred.t

(describe-function 'run-hooks) (Info-goto-node "(elisp)Running Hooks")

val after_change_functions : (after_change, unit) t

(describe-variable 'after-change-functions) (Info-goto-node "(elisp)Change Hooks")

val after_load : (file, unit) t

(describe-variable 'after-load-functions) (Info-goto-node "(elisp)Hooks for Loading")

val after_revert : (normal, unit) t

(describe-variable 'after-revert-hook) (Info-goto-node "(elisp)Reverting")

val after_save : (normal, unit) t

(describe-variable 'after-save-hook) (Info-goto-node "(elisp)Saving Buffers")

val before_change_functions : (before_change, unit) t

(describe-variable 'before-change-functions) (Info-goto-node "(elisp)Change Hooks")

val before_save : (normal, unit) t

(describe-variable 'before-save-hook) (Info-goto-node "(elisp)Saving Buffers")

val emacs_startup : (normal, unit) t

(describe-variable 'emacs-startup-hook)

Use this instead of (describe-variable 'after-init-hook), since the latter occurs before command-line arguments are handled (and therefore before the OCaml runtime is initialized).

val focus_in : (normal, unit) t

(describe-variable 'focus-in-hook) (Info-goto-node "(elisp)Input Focus")

val kill_buffer : (normal, unit) t

(describe-variable 'kill-buffer-hook) (Info-goto-node "(elisp)Killing Buffers")

val post_command : (normal, unit) t

(describe-variable 'post-command-hook) (Info-goto-node "(elisp)Command Overview")

val server_after_make_frame : (normal, unit) t

(describe-variable 'server-after-make-frame-hook)

val window_configuration_change : (normal, unit) t

(describe-variable 'window-configuration-change-hook) (Info-goto-node "(elisp)Window Hooks")

val window_scroll_functions : (window, unit) t

(describe-variable 'window-scroll-functions) (Info-goto-node "(elisp)Window Hooks")

val major_mode_hook : Major_mode.t -> (normal, unit) t

(Info-goto-node "(elisp)Major Mode Conventions")

OCaml

Innovation. Community. Security.