comparison man/major.texi @ 38461:23f63206a867

Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 17 Jul 2001 10:50:35 +0000
parents e11682cc1516
children 5464ee1ba8e2
comparison
equal deleted inserted replaced
38460:6bee7ffac2cd 38461:23f63206a867
29 addition, the commands which handle comments use the mode to determine 29 addition, the commands which handle comments use the mode to determine
30 how comments are to be delimited. Many major modes redefine the 30 how comments are to be delimited. Many major modes redefine the
31 syntactical properties of characters appearing in the buffer. 31 syntactical properties of characters appearing in the buffer.
32 @xref{Syntax}. 32 @xref{Syntax}.
33 33
34 The major modes fall into three major groups. Lisp mode (which has 34 The major modes fall into three major groups. The first group
35 several variants), C mode, Fortran mode and others are for specific 35 contains Lisp mode (which has several variants), C mode, Fortran mode
36 programming languages. Text mode, Nroff mode, SGML mode, @TeX{} mode 36 and others. These modes are for specific programming languages. The
37 and Outline mode are for normal text, plain or marked up. The remaining 37 second group contains Text mode, Nroff mode, SGML mode, @TeX{} mode
38 major modes are not intended for use on users' files; they are used in 38 and Outline mode. These modes are for normal text, plain or marked
39 buffers created for specific purposes by Emacs, such as Dired mode for 39 up. The remaining major modes are not intended for use on users'
40 buffers made by Dired (@pxref{Dired}), Mail mode for buffers made by 40 files; they are used in buffers created for specific purposes by
41 @kbd{C-x m} (@pxref{Sending Mail}), and Shell mode for buffers used for 41 Emacs, such as Dired mode for buffers made by Dired (@pxref{Dired}),
42 communicating with an inferior shell process (@pxref{Interactive 42 Mail mode for buffers made by @kbd{C-x m} (@pxref{Sending Mail}), and
43 Shell}). 43 Shell mode for buffers used for communicating with an inferior shell
44 process (@pxref{Interactive Shell}).
44 45
45 Most programming-language major modes specify that only blank lines 46 Most programming-language major modes specify that only blank lines
46 separate paragraphs. This is to make the paragraph commands useful. 47 separate paragraphs. This is to make the paragraph commands useful.
47 (@xref{Paragraphs}.) They also cause Auto Fill mode to use the 48 (@xref{Paragraphs}.) They also cause Auto Fill mode to use the
48 definition of @key{TAB} to indent the new lines it creates. This is 49 definition of @key{TAB} to indent the new lines it creates. This is
86 87
87 @noindent 88 @noindent
88 For example, one element normally found in the list has the form 89 For example, one element normally found in the list has the form
89 @code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C 90 @code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C
90 mode for files whose names end in @file{.c}. (Note that @samp{\\} is 91 mode for files whose names end in @file{.c}. (Note that @samp{\\} is
91 needed in Lisp syntax to include a @samp{\} in the string, which is 92 needed in Lisp syntax to include a @samp{\} in the string, which must
92 needed to suppress the special meaning of @samp{.} in regexps.) If the 93 be used to suppress the special meaning of @samp{.} in regexps.) If the
93 element has the form @code{(@var{regexp} @var{mode-function} 94 element has the form @code{(@var{regexp} @var{mode-function}
94 @var{flag})} and @var{flag} is non-@code{nil}, then after calling 95 @var{flag})} and @var{flag} is non-@code{nil}, then after calling
95 @var{mode-function}, the suffix that matched @var{regexp} is discarded 96 @var{mode-function}, the suffix that matched @var{regexp} is discarded
96 and the list is searched again for another match. 97 and the list is searched again for another match.
97 98
104 ;-*-Lisp-*- 105 ;-*-Lisp-*-
105 @end example 106 @end example
106 107
107 @noindent 108 @noindent
108 tells Emacs to use Lisp mode. Such an explicit specification overrides 109 tells Emacs to use Lisp mode. Such an explicit specification overrides
109 any defaulting based on the file name. Note how the semicolon is used 110 any defaults based on the file name. Note how the semicolon is used
110 to make Lisp treat this line as a comment. 111 to make Lisp treat this line as a comment.
111 112
112 Another format of mode specification is 113 Another format of mode specification is
113 114
114 @example 115 @example
156 @findex normal-mode 157 @findex normal-mode
157 If you change the major mode of a buffer, you can go back to the major 158 If you change the major mode of a buffer, you can go back to the major
158 mode Emacs would choose automatically: use the command @kbd{M-x 159 mode Emacs would choose automatically: use the command @kbd{M-x
159 normal-mode} to do this. This is the same function that 160 normal-mode} to do this. This is the same function that
160 @code{find-file} calls to choose the major mode. It also processes 161 @code{find-file} calls to choose the major mode. It also processes
161 the file's local variables list if any. 162 the file's local variables list (if any).
162 163
163 @vindex change-major-mode-with-file-name 164 @vindex change-major-mode-with-file-name
164 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to 165 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to
165 a new major mode if the new file name implies a mode (@pxref{Saving}). 166 a new major mode if the new file name implies a mode (@pxref{Saving}).
166 However, this does not happen if the buffer contents specify a major 167 However, this does not happen if the buffer contents specify a major