123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113(** Major modes specialize Emacs for editing particular kinds of text. Each buffer has
only one major mode at a time.
[(Info-goto-node "(elisp)Major Modes")] *)open!Core_kernelopen!Async_kernelopen!ImportmoduleHook=Hook0moduletypeS=sigtypettypename=..typename+=Major_modevalmajor_mode:tendmoduletypeMajor_mode=sigtypet[@@derivingsexp_of]includeEqual.Swithtypet:=t(** Accessors *)valsymbol:t->Symbol.tmoduleName:sig(** Names let us pattern-match on major modes. *)typet=..(** Dummy value for modes we don't care about matching. *)typet+=Undistinguishedendvalname:t->Name.tvalhook:t->Hook.normalHook.tvalkeymap:t->Keymap.tvalkeymap_var:t->Keymap.tVar.tvalsyntax_table:t->Syntax_table.tmoduletypeS=Swithtypet:=tandtypename:=Name.t(** [wrap_existing mode_name] wraps the existing Emacs major mode named [mode_name], and
stores it in the table of all major modes indexed by symbol. [wrap_existing] raises
if a major mode associated with this symbol was already wrapped. *)valwrap_existing:string->Source_code_position.t->(moduleS)(** [find_or_wrap_existing] looks up the major mode associated with this symbol by a
previous call to [wrap_existing] or creates one with the [Undistinguished] name. *)valfind_or_wrap_existing:Source_code_position.t->Symbol.t->tvalchange_to:t->in_:Buffer.t->unitDeferred.t(** [(describe-function 'fundamental-mode)]
[(Info-goto-node "(elisp)Major Modes")] *)moduleFundamental:S(** [(describe-function 'prog-mode)]
[(Info-goto-node "(elisp)Basic Major Modes")] *)moduleProg:S(** [(describe-function 'special-mode)]
[(Info-goto-node "(elisp)Basic Major Modes")] *)moduleSpecial:S(** [(describe-function 'text-mode)]
[(Info-goto-node "(elisp)Basic Major Modes")] *)moduleText:S(** [(describe-function 'dired-mode)] *)moduleDired:S(** [(describe-function 'tuareg-mode)] *)moduleTuareg:S(** [(describe-function 'makefile-mode)] *)moduleMakefile:S(** [(describe-function 'lisp-mode)] *)moduleLisp:S(** [(describe-function 'scheme-mode)] *)moduleScheme:S(** [(describe-function 'emacs-lisp-mode)] *)moduleEmacs_lisp:S(** [(describe-function 'define-derived-mode)]
[(Info-goto-node "(elisp)Derived Modes")]
Additionally, each [key_sequence, symbol] in [define_keys] is added to the new major
mode's keymap. *)valdefine_derived_mode:Symbol.t->Source_code_position.t->docstring:string->?define_keys:(string*Symbol.t)list->mode_line:string->?parent:t->?initialize:(unit,'a)Defun.Returns.t*(unit->'a)->unit->(moduleS)valis_derived:t->from:t->bool(** [(describe-variable 'major-mode)] *)valmajor_mode_var:Symbol.tBuffer_local.tmoduleFor_testing:sigvalall_derived_modes:unit->tlistendend