]> code.delx.au - gnu-emacs/blobdiff - lispref/modes.texi
(rmail-unix-mail-delimiter):
[gnu-emacs] / lispref / modes.texi
index 77cb11302a03b881a6fcfc1b8c0bb82c0878348a..e7b164f3b2c521caf4ba696dd5565a2d14aeea2b 100644 (file)
@@ -142,6 +142,9 @@ This keymap should be kept in a global variable named
 @code{@var{modename}-mode-map}.  Normally the library that defines the
 mode sets this variable.
 
+@xref{Tips for Defining}, for advice about how to write the code to set
+up the mode's keymap variable.
+
 @item
 @cindex syntax tables in modes
 The mode may have its own syntax table or may share one with other
@@ -538,7 +541,8 @@ the user what to do for each file.  The default value is @code{maybe}.
 @cindex visited file mode
   This function selects the major mode that is appropriate for the
 current buffer.  It may base its decision on the value of the @w{@samp{-*-}}
-line, on the visited file name (using @code{auto-mode-alist}), or on the
+line, on the visited file name (using @code{auto-mode-alist}), on the
+@w{@samp{#!}} line (using @code{interpreter-mode-alist}), or on the
 value of a local variable.  However, this function does not look for
 the @samp{mode:} local variable near the end of a file; the
 @code{hack-local-variables} function does that.  @xref{Choosing Modes, ,
@@ -635,7 +639,7 @@ Here is an example of how to prepend several pattern pairs to
 
 @defvar interpreter-mode-alist
 This variable specifes major modes to use for scripts that specify a
-command interpreter in an @samp{!#} line.  Its value is a list of
+command interpreter in an @samp{#!} line.  Its value is a list of
 elements of the form @code{(@var{interpreter} . @var{mode})}; for
 example, @code{("perl" . perl-mode)} is one element present by default.
 The element says to use mode @var{mode} if the file specifies
@@ -1383,6 +1387,13 @@ This function makes the hook variable @code{hook} local to the current
 buffer.  When a hook variable is local, it can have local and global
 hook functions, and @code{run-hooks} runs all of them.
 
+This function works by making @code{t} an element of the buffer-local
+value.  That serves as a flag to use the hook functions in the default
+value of the hook variable as well as those in the local value.  Since
+@code{run-hooks} understands this flag, @code{make-local-hook} works
+with all normal hooks.  It works for only some non-normal hooks---those
+whose callers have been updated to understand this meaning of @code{t}.
+
 Do not use @code{make-local-variable} directly for hook variables; it is
 not sufficient.
 @end defun