# HG changeset patch # User Richard M. Stallman # Date 845136609 0 # Node ID 6f58503776e5a6ae8bbabe8db5da98e1d85effc2 # Parent 65d3768ccb05f523ed3e4620aa6bce91983693b5 Explain what major modes can do for imenu and font-lock. diff -r 65d3768ccb05 -r 6f58503776e5 lispref/modes.texi --- a/lispref/modes.texi Sat Oct 12 16:08:08 1996 +0000 +++ b/lispref/modes.texi Sat Oct 12 16:10:09 1996 +0000 @@ -153,6 +153,11 @@ Tables}. @item +If the mode handles a language that has a syntax for comments, it should +set the variables that define the comment syntax. @xref{Options for +Comments,, Options Controlling Comments, emacs, The GNU Emacs Manual}. + +@item @cindex abbrev tables in modes The mode may have its own abbrev table or may share one with other related modes. If it has its own abbrev table, it should store this in @@ -160,6 +165,20 @@ Tables}. @item +@vindex font-lock-defaults +The mode should specify how to do highlighting for Font Lock mode, by +setting up a buffer-local value for the variable +@code{font-lock-defaults}. + +@item +@vindex imenu-generic-expression +@vindex imenu-create-index-function +The mode should specify how Imenu should find the definitions or +sections of a buffer, by setting up a buffer-local value for the +variable @code{imenu-generic-expression} or +@code{imenu-create-index-function}. + +@item Use @code{defvar} to set mode-related variables, so that they are not reinitialized if they already have a value. (Such reinitialization could discard customizations made by the user.)