Ecaml.HookA 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")
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.ttype after_change = {beginning_of_changed_region : Position.t;end_of_changed_region : Position.t;length_before_change : int;}val sexp_of_after_change : after_change -> Sexplib0.Sexp.tval sexp_of_before_change : before_change -> Sexplib0.Sexp.tval sexp_of_file : file -> Sexplib0.Sexp.tval sexp_of_normal : normal -> Sexplib0.Sexp.tval sexp_of_frame : frame -> Sexplib0.Sexp.tval sexp_of_window : window -> Sexplib0.Sexp.tmodule Hook_type : sig ... endmodule Wrap : sig ... endval var : _ t -> Ecaml_value.Function.t list Var.tmodule Where : sig ... endmodule Function : sig ... endval add :
?buffer_local:bool ->
?one_shot:bool ->
?where:Where.t ->
'a t ->
'a 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 t -> 'a Function.t -> unit(describe-function 'remove-hook) (Info-goto-node "(elisp)Setting Hooks")
val clear : _ t -> unit(describe-function 'run-hooks) (Info-goto-node "(elisp)Running Hooks")
val after_change_functions : after_change t(describe-variable 'after-change-functions) (Info-goto-node "(elisp)Change Hooks")
(describe-variable 'after-load-functions) (Info-goto-node "(elisp)Hooks for Loading")
(describe-variable 'after-revert-hook) (Info-goto-node "(elisp)Reverting")
(describe-variable 'after-save-hook) (Info-goto-node "(elisp)Saving Buffers")
val before_change_functions : before_change t(describe-variable 'before-change-functions) (Info-goto-node "(elisp)Change Hooks")
(describe-variable 'before-save-hook) (Info-goto-node "(elisp)Saving Buffers")
(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).
(describe-variable 'kill-buffer-hook) (Info-goto-node "(elisp)Killing Buffers")
(describe-variable 'post-command-hook) (Info-goto-node "(elisp)Command Overview")
(describe-variable 'window-configuration-change-hook) (Info-goto-node "(elisp)Window Hooks")
(describe-variable 'window-scroll-functions) (Info-goto-node "(elisp)Window Hooks")
val major_mode_hook : Major_mode.t -> normal t(Info-goto-node "(elisp)Major Mode Conventions")