Add the ability to exclude dir-locals from subdirs. (Bug#8100)
[bpt/emacs.git] / doc / emacs / major.texi
index 674239b..9256c71 100644 (file)
@@ -1,6 +1,6 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
-@c   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
+@c   Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Major Modes, Indentation, International, Top
 @chapter Major Modes
@@ -41,7 +41,7 @@ languages.  These include Lisp mode (which has several variants), C
 mode, Fortran mode, and others.  The remaining major modes are not
 intended for use on users' files; they are used in buffers created for
 specific purposes by Emacs, such as Dired mode for buffers made by
-Dired (@pxref{Dired}), Mail mode for buffers made by @kbd{C-x m}
+Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m}
 (@pxref{Sending Mail}), and Shell mode for buffers used for
 communicating with an inferior shell process (@pxref{Interactive
 Shell}).
@@ -196,17 +196,33 @@ only after @code{auto-mode-alist}.  By default,
 @code{magic-fallback-mode-alist} contains forms that check for image
 files, HTML/XML/SGML files, and Postscript files.
 
-  When you visit a file that does not specify a major mode to use, or
-when you create a new buffer with @kbd{C-x b}, the default value of
-the variable @code{major-mode} specifies which major mode to use.  Normally
-its value is the symbol @code{fundamental-mode}, which specifies
-Fundamental mode.  If the default value of @code{major-mode} is @code{nil},
-the major mode is taken from the previously current buffer.
+@vindex major-mode
+  Once a major mode is chosen, Emacs sets the value of the variable
+@code{major-mode} to the symbol for that major mode (e.g.,
+@code{text-mode} for Text mode).  This is a per-buffer variable
+(@pxref{Locals}); its buffer-local value is set automatically, and you
+should not change it yourself.
+
+  The default value of @code{major-mode} determines the major mode to
+use for files that do not specify a major mode, and for new buffers
+created with @kbd{C-x b}.  Normally, this default value is the symbol
+@code{fundamental-mode}, which specifies Fundamental mode.  You can
+change it via the Customization interface (@pxref{Easy
+Customization}), or by adding a line like this to your init file
+(@pxref{Init File}):
+
+@smallexample
+(setq-default major-mode 'text-mode)
+@end smallexample
+
+@noindent
+If the default value of @code{major-mode} is @code{nil}, the major
+mode is taken from the previously current buffer.
 
 @findex normal-mode
-  If you change the major mode of a buffer, you can go back to the major
-mode Emacs would choose automatically: use the command @kbd{M-x
-normal-mode} to do this.  This is the same function that
+  If you have changed the major mode of a buffer, you can return to
+the major mode Emacs would have chosen automatically, by typing
+@kbd{M-x normal-mode}.  This is the same function that
 @code{find-file} calls to choose the major mode.  It also processes
 the file's @samp{-*-} line or local variables list (if any).
 @xref{File Variables}.
@@ -219,7 +235,3 @@ However, this does not happen if the buffer contents specify a major
 mode, and certain ``special'' major modes do not allow the mode to
 change.  You can turn off this mode-changing feature by setting
 @code{change-major-mode-with-file-name} to @code{nil}.
-
-@ignore
-   arch-tag: f2558800-cf32-4839-8acb-7d3b4df2a155
-@end ignore