123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150(** 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!Coreopen!Async_kernelopen!ImportmoduleHook=Hook0moduleAuto_mode=structtypet=|If_filename_matchesofRegexp.t|If_filename_matches_then_delete_suffix_and_recurofRegexp.tendmoduleName=struct(** Names let us pattern-match on major modes. *)typet=..(** Dummy value for modes we don't care about matching. *)typet+=UndistinguishedendmoduleIntf(T:T)=structopenTmoduletypeS_with_lazy_keymap=sigtypeName.t+=Major_modevalmajor_mode:tvalkeymap:Keymap.tLazy.tvalenabled_in_current_buffer:unit->boolendmoduletypeS=sigincludeS_with_lazy_keymapvalkeymap:Keymap.tendendmoduletypeMajor_mode=sigmoduleAuto_mode=Auto_modemoduleName=Nametypet[@@derivingsexp_of]includeEqual.Swithtypet:=tmoduleCompare_by_name:sigtypenonrect=t[@@derivingcompare,equal,hash,sexp_of]endincludemoduletypeofIntf(structtypenonrect=tend)(** Accessors *)valsymbol:t->Symbol.tvalname:t->Name.tvalhook:t->Hook.normalHook.tOr_error.tvalkeymap:t->Keymap.tvalkeymap_var:t->Keymap.tVar.tvalsyntax_table:t->Syntax_table.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)(** [wrap_existing_with_lazy_keymap] is like [wrap_existing], except the resulting
module's [keymap] value has type [Keymap.t Lazy.t] rather than [Keymap.t]. This is
needed if the keymap value isn't defined at the point that the major mode is
wrapped. *)valwrap_existing_with_lazy_keymap:string->Source_code_position.t->(moduleS_with_lazy_keymap)(** [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_with_lazy_keymap(** [(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_with_lazy_keymap(** [(describe-function 'tuareg-mode)] *)moduleTuareg:S_with_lazy_keymap(** [(describe-function 'makefile-mode)] *)moduleMakefile:S_with_lazy_keymap(** [(describe-function 'lisp-mode)] *)moduleLisp:S(** [(describe-function 'scheme-mode)] *)moduleScheme:S_with_lazy_keymap(** [(describe-function 'emacs-lisp-mode)] *)moduleEmacs_lisp:S(** [(describe-function 'asm-mode)] *)moduleAsm:S_with_lazy_keymap(** [(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:?auto_mode:Auto_mode.t->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