+ A snapshot uses a very small amount of resources---just enough to record
+the list of file names and which version belongs to the snapshot. Thus,
+you need not hesitate to create snapshots whenever they are useful.
+
+ You can give a snapshot name as an argument to @kbd{C-x v =} or
+@kbd{C-x v ~} (@pxref{Old Versions,,,emacs, the Emacs Manual}).
+Thus, you can use it to compare a snapshot against the current files,
+or two snapshots against each other, or a snapshot against a named
+version.
+
+@node Snapshot Caveats
+@subsection Snapshot Caveats
+
+@cindex named configurations (RCS)
+ VC's snapshot facilities are modeled on RCS's named-configuration
+support. They use RCS's native facilities for this, so
+snapshots made using RCS through VC are visible even when you bypass VC.
+
+ With CVS, Meta-CVS, and Subversion, VC also uses the native
+mechanism provided by that back end to make snapshots and retrieve them
+(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
+
+@c worded verbosely to avoid overfull hbox.
+ For SCCS, VC implements snapshots itself. The files it uses contain
+name/file/version-number triples. These snapshots are visible only
+through VC.
+
+ There is no support for VC snapshots using GNU Arch yet.
+
+ A snapshot is a set of checked-in versions. So make sure that all the
+files are checked in and not locked when you make a snapshot.
+
+ File renaming and deletion can create some difficulties with snapshots.
+This is not a VC-specific problem, but a general design issue in version
+control systems that no one has solved very well yet.
+
+ If you rename a registered file, you need to rename its master along
+with it (the command @code{vc-rename-file} does this automatically). If
+you are using SCCS, you must also update the records of the snapshot, to
+mention the file by its new name (@code{vc-rename-file} does this,
+too). An old snapshot that refers to a master file that no longer
+exists under the recorded name is invalid; VC can no longer retrieve
+it. It would be beyond the scope of this manual to explain enough about
+RCS and SCCS to explain how to update the snapshots by hand.
+
+ Using @code{vc-rename-file} makes the snapshot remain valid for
+retrieval, but it does not solve all problems. For example, some of the
+files in your program probably refer to others by name. At the very
+least, the makefile probably mentions the file that you renamed. If you
+retrieve an old snapshot, the renamed file is retrieved under its new
+name, which is not the name that the makefile expects. So the program
+won't really work as retrieved.
+
+@node Miscellaneous VC
+@section Miscellaneous Commands and Features of VC
+
+ This section explains the less-frequently-used features of VC.
+
+@menu
+* Change Logs and VC:: Generating a change log file from log entries.
+* Renaming and VC:: A command to rename both the source and master
+ file correctly.
+* Version Headers:: Inserting version control headers into working files.
+@end menu
+
+@node Change Logs and VC
+@subsection Change Logs and VC
+
+ If you use RCS or CVS for a program and also maintain a change log
+file for it (@pxref{Change Log,,,emacs, the Emacs Manual}), you
+can generate change log entries automatically from the version control
+log entries:
+
+@table @kbd
+@item C-x v a
+@kindex C-x v a
+@findex vc-update-change-log
+Visit the current directory's change log file and, for registered files
+in that directory, create new entries for versions checked in since the
+most recent entry in the change log file.
+(@code{vc-update-change-log}).
+
+This command works with RCS or CVS only, not with any of the other
+back ends.
+
+@item C-u C-x v a
+As above, but only find entries for the current buffer's file.
+
+@item M-1 C-x v a
+As above, but find entries for all the currently visited files that are
+maintained with version control. This works only with RCS, and it puts
+all entries in the log for the default directory, which may not be
+appropriate.
+@end table
+
+ For example, suppose the first line of @file{ChangeLog} is dated
+1999-04-10, and that the only check-in since then was by Nathaniel
+Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
+messages that start with `#'.}. Then @kbd{C-x v a} visits
+@file{ChangeLog} and inserts text like this:
+
+@iftex
+@medbreak
+@end iftex
+@smallexample
+@group
+1999-05-22 Nathaniel Bowditch <nat@@apn.org>
+
+ * rcs2log: Ignore log messages that start with `#'.
+@end group
+@end smallexample
+@iftex
+@medbreak
+@end iftex
+
+@noindent
+You can then edit the new change log entry further as you wish.
+
+ Some of the new change log entries may duplicate what's already in
+ChangeLog. You will have to remove these duplicates by hand.
+
+ Normally, the log entry for file @file{foo} is displayed as @samp{*
+foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted
+if the text of the log entry starts with @w{@samp{(@var{functionname}):
+}}. For example, if the log entry for @file{vc.el} is
+@samp{(vc-do-command): Check call-process status.}, then the text in
+@file{ChangeLog} looks like this:
+
+@iftex
+@medbreak
+@end iftex
+@smallexample
+@group
+1999-05-06 Nathaniel Bowditch <nat@@apn.org>
+
+ * vc.el (vc-do-command): Check call-process status.
+@end group
+@end smallexample
+@iftex
+@medbreak
+@end iftex
+
+ When @kbd{C-x v a} adds several change log entries at once, it groups
+related log entries together if they all are checked in by the same
+author at nearly the same time. If the log entries for several such
+files all have the same text, it coalesces them into a single entry.
+For example, suppose the most recent check-ins have the following log
+entries:
+
+@flushleft
+@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
+@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
+@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
+@end flushleft
+
+@noindent
+They appear like this in @file{ChangeLog}:
+
+@iftex
+@medbreak
+@end iftex
+@smallexample
+@group
+1999-04-01 Nathaniel Bowditch <nat@@apn.org>
+
+ * vc.texinfo: Fix expansion typos.
+
+ * vc.el, vc-hooks.el: Don't call expand-file-name.
+@end group
+@end smallexample
+@iftex
+@medbreak
+@end iftex
+
+ Normally, @kbd{C-x v a} separates log entries by a blank line, but you
+can mark several related log entries to be clumped together (without an
+intervening blank line) by starting the text of each related log entry
+with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label
+itself is not copied to @file{ChangeLog}. For example, suppose the log
+entries are:
+
+@flushleft
+@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
+@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
+@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
+@end flushleft
+
+@noindent
+Then the text in @file{ChangeLog} looks like this:
+
+@iftex
+@medbreak
+@end iftex
+@smallexample
+@group
+1999-04-01 Nathaniel Bowditch <nat@@apn.org>
+
+ * vc.texinfo: Fix expansion typos.
+ * vc.el, vc-hooks.el: Don't call expand-file-name.
+@end group
+@end smallexample
+@iftex
+@medbreak
+@end iftex
+
+ A log entry whose text begins with @samp{#} is not copied to
+@file{ChangeLog}. For example, if you merely fix some misspellings in
+comments, you can log the change with an entry beginning with @samp{#}
+to avoid putting such trivia into @file{ChangeLog}.
+
+@node Renaming and VC
+@subsection Renaming VC Work Files and Master Files
+
+@findex vc-rename-file
+ When you rename a registered file, you must also rename its master
+file correspondingly to get proper results. Use @code{vc-rename-file}
+to rename the source file as you specify, and rename its master file
+accordingly. It also updates any snapshots (@pxref{Snapshots}) that
+mention the file, so that they use the new name; despite this, the
+snapshot thus modified may not completely work (@pxref{Snapshot
+Caveats}).
+
+ Some back ends do not provide an explicit rename operation to their
+repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v}
+on the original and renamed buffers and provide the necessary edit
+log.
+
+ You cannot use @code{vc-rename-file} on a file that is locked by
+someone else.
+
+@node Version Headers
+@subsection Inserting Version Control Headers
+
+ Sometimes it is convenient to put version identification strings
+directly into working files. Certain special strings called
+@dfn{version headers} are replaced in each successive version by the
+number of that version, the name of the user who created it, and other
+relevant information. All of the back ends that VC supports have such
+a mechanism, except GNU Arch.
+
+ VC does not normally use the information contained in these headers.
+The exception is RCS---with RCS, version headers are sometimes more
+reliable than the master file to determine which version of the file
+you are editing. Note that in a multi-branch environment, version
+headers are necessary to make VC behave correctly (@pxref{Multi-User
+Branching,,,emacs, the Emacs Manual}).
+
+ Searching for RCS version headers is controlled by the variable
+@code{vc-consult-headers}. If it is non-@code{nil} (the default),
+Emacs searches for headers to determine the version number you are
+editing. Setting it to @code{nil} disables this feature.
+
+ Note that although CVS uses the same kind of version headers as RCS
+does, VC never searches for these headers if you are using CVS,
+regardless of the above setting.
+
+@kindex C-x v h
+@findex vc-insert-headers
+ You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
+insert a suitable header string.
+
+@table @kbd
+@item C-x v h
+Insert headers in a file for use with your version-control system.
+@end table
+
+@vindex vc-@var{backend}-header
+ The default header string is @samp{@w{$}Id$} for RCS and
+@samp{@w{%}W%} for SCCS. You can specify other headers to insert by
+setting the variables @code{vc-@var{backend}-header} where
+@var{backend} is @code{rcs} or @code{sccs}.
+
+ Instead of a single string, you can specify a list of strings; then
+each string in the list is inserted as a separate header on a line of
+its own.
+
+ It may be necessary to use apparently-superfluous backslashes when
+writing the strings that you put in this variable. For instance, you
+might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra
+backslash prevents the string constant from being interpreted as a
+header, if the Emacs Lisp file containing it is maintained with
+version control.
+
+@vindex vc-comment-alist
+ Each header is inserted surrounded by tabs, inside comment delimiters,
+on a new line at point. Normally the ordinary comment
+start and comment end strings of the current mode are used, but for
+certain modes, there are special comment delimiters for this purpose;
+the variable @code{vc-comment-alist} specifies them. Each element of
+this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
+
+@vindex vc-static-header-alist
+ The variable @code{vc-static-header-alist} specifies further strings
+to add based on the name of the buffer. Its value should be a list of
+elements of the form @code{(@var{regexp} . @var{format})}. Whenever
+@var{regexp} matches the buffer name, @var{format} is inserted as part
+of the header. A header line is inserted for each element that matches
+the buffer name, and for each string specified by
+@code{vc-@var{backend}-header}. The header line is made by processing the
+string from @code{vc-@var{backend}-header} with the format taken from the
+element. The default value for @code{vc-static-header-alist} is as follows:
+
+@example
+@group
+(("\\.c$" .
+ "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
+#endif /* lint */\n"))
+@end group
+@end example
+
+@noindent
+It specifies insertion of text of this form:
+
+@example
+@group
+
+#ifndef lint
+static char vcid[] = "@var{string}";
+#endif /* lint */
+@end group
+@end example
+
+@noindent
+Note that the text above starts with a blank line.
+
+ If you use more than one version header in a file, put them close
+together in the file. The mechanism in @code{revert-buffer} that
+preserves markers may not handle markers positioned between two version
+headers.
+
+@node Customizing VC
+@section Customizing VC
+
+@vindex vc-handled-backends
+The variable @code{vc-handled-backends} determines which version
+control systems VC should handle. The default value is @code{(RCS CVS
+SVN SCCS Arch MCVS)}, so it contains all six version systems that are
+currently supported. If you want VC to ignore one or more of these
+systems, exclude its name from the list. To disable VC entirely, set
+this variable to @code{nil}.
+
+The order of systems in the list is significant: when you visit a file
+registered in more than one system (@pxref{Local Version Control}), VC
+uses the system that comes first in @code{vc-handled-backends} by
+default. The order is also significant when you register a file for
+the first time, @pxref{Registering,,,emacs, the Emacs Manual} for
+details.
+
+@menu
+* General VC Options:: Options that apply to multiple back ends.
+* RCS and SCCS:: Options for RCS and SCCS.
+* CVS Options:: Options for CVS.
+@end menu
+
+@node General VC Options
+@subsection General Options
+
+@vindex vc-make-backup-files
+ Emacs normally does not save backup files for source files that are
+maintained with version control. If you want to make backup files even
+for files that use version control, set the variable
+@code{vc-make-backup-files} to a non-@code{nil} value.
+
+@vindex vc-keep-workfiles
+ Normally the work file exists all the time, whether it is locked or
+not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking
+in a new version with @kbd{C-x v v} deletes the work file; but any
+attempt to visit the file with Emacs creates it again. (With CVS, work
+files are always kept.)
+
+@vindex vc-follow-symlinks
+ Editing a version-controlled file through a symbolic link can be
+dangerous. It bypasses the version control system---you can edit the
+file without locking it, and fail to check your changes in. Also,
+your changes might overwrite those of another user. To protect against
+this, VC checks each symbolic link that you visit, to see if it points
+to a file under version control.
+
+ The variable @code{vc-follow-symlinks} controls what to do when a
+symbolic link points to a version-controlled file. If it is @code{nil},
+VC only displays a warning message. If it is @code{t}, VC automatically
+follows the link, and visits the real file instead, telling you about
+this in the echo area. If the value is @code{ask} (the default), VC
+asks you each time whether to follow the link.
+
+@vindex vc-suppress-confirm
+ If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
+and @kbd{C-x v i} can save the current buffer without asking, and
+@kbd{C-x v u} also operates without asking for confirmation. (This
+variable does not affect @kbd{C-x v c}; that operation is so drastic
+that it should always ask for confirmation.)
+
+@vindex vc-command-messages
+ VC mode does much of its work by running the shell commands for RCS,
+CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC
+displays messages to indicate which shell commands it runs, and
+additional messages when the commands finish.
+
+@vindex vc-path
+ You can specify additional directories to search for version control
+programs by setting the variable @code{vc-path}. These directories
+are searched before the usual search path. It is rarely necessary to
+set this variable, because VC normally finds the proper files
+automatically.
+
+@node RCS and SCCS
+@subsection Options for RCS and SCCS
+
+@cindex non-strict locking (RCS)
+@cindex locking, non-strict (RCS)
+ By default, RCS uses locking to coordinate the activities of several
+users, but there is a mode called @dfn{non-strict locking} in which
+you can check-in changes without locking the file first. Use
+@samp{rcs -U} to switch to non-strict locking for a particular file,
+see the @code{rcs} manual page for details.
+
+ When deducing the version control state of an RCS file, VC first
+looks for an RCS version header string in the file (@pxref{Version
+Headers}). If there is no header string, VC normally looks at the
+file permissions of the work file; this is fast. But there might be
+situations when the file permissions cannot be trusted. In this case
+the master file has to be consulted, which is rather expensive. Also
+the master file can only tell you @emph{if} there's any lock on the
+file, but not whether your work file really contains that locked
+version.
+
+@vindex vc-consult-headers
+ You can tell VC not to use version headers to determine the file
+status by setting @code{vc-consult-headers} to @code{nil}. VC then
+always uses the file permissions (if it is supposed to trust them), or
+else checks the master file.
+
+@vindex vc-mistrust-permissions
+ You can specify the criterion for whether to trust the file
+permissions by setting the variable @code{vc-mistrust-permissions}.
+Its value can be @code{t} (always mistrust the file permissions and
+check the master file), @code{nil} (always trust the file
+permissions), or a function of one argument which makes the decision.
+The argument is the directory name of the @file{RCS} subdirectory. A
+non-@code{nil} value from the function says to mistrust the file
+permissions. If you find that the file permissions of work files are
+changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
+Then VC always checks the master file to determine the file's status.
+
+ VC determines the version control state of files under SCCS much as
+with RCS. It does not consider SCCS version headers, though. Thus,
+the variable @code{vc-mistrust-permissions} affects SCCS use, but
+@code{vc-consult-headers} does not.
+
+@node CVS Options
+@subsection Options specific for CVS
+
+@cindex locking (CVS)
+ By default, CVS does not use locking to coordinate the activities of
+several users; anyone can change a work file at any time. However,
+there are ways to restrict this, resulting in behavior that resembles
+locking.
+
+@cindex CVSREAD environment variable (CVS)
+ For one thing, you can set the @env{CVSREAD} environment variable
+(the value you use makes no difference). If this variable is defined,
+CVS makes your work files read-only by default. In Emacs, you must
+type @kbd{C-x v v} to make the file writable, so that editing works
+in fact similar as if locking was used. Note however, that no actual
+locking is performed, so several users can make their files writable
+at the same time. When setting @env{CVSREAD} for the first time, make
+sure to check out all your modules anew, so that the file protections
+are set correctly.
+
+@cindex cvs watch feature
+@cindex watching files (CVS)
+ Another way to achieve something similar to locking is to use the
+@dfn{watch} feature of CVS. If a file is being watched, CVS makes it
+read-only by default, and you must also use @kbd{C-x v v} in Emacs to
+make it writable. VC calls @code{cvs edit} to make the file writable,
+and CVS takes care to notify other developers of the fact that you
+intend to change the file. See the CVS documentation for details on
+using the watch feature.
+
+@vindex vc-stay-local
+@vindex vc-cvs-stay-local
+@cindex remote repositories (CVS)
+ When a file's repository is on a remote machine, VC tries to keep
+network interactions to a minimum. This is controlled by the variable
+@code{vc-cvs-stay-local}. There is another variable,
+@code{vc-stay-local}, which enables the feature also for other back
+ends that support it, including CVS. In the following, we will talk
+only about @code{vc-cvs-stay-local}, but everything applies to
+@code{vc-stay-local} as well.
+
+If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
+only the entry in the local CVS subdirectory to determine the file's
+state (and possibly information returned by previous CVS commands).
+One consequence of this is that when you have modified a file, and
+somebody else has already checked in other changes to the file, you
+are not notified of it until you actually try to commit. (But you can
+try to pick up any recent changes from the repository first, using
+@kbd{C-x v m @key{RET}}, @pxref{Merging,,,emacs, the Emacs Manual}).
+
+ When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
+version backups, so that simple diff and revert operations are
+completely local (@pxref{Version Backups}).
+
+ On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
+then VC queries the remote repository @emph{before} it decides what to
+do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
+repositories. It also does not make any version backups.
+
+ You can also set @code{vc-cvs-stay-local} to a regular expression
+that is matched against the repository host name; VC then stays local
+only for repositories from hosts that match the pattern.
+
+@vindex vc-cvs-global-switches
+ You can specify additional command line options to pass to all CVS
+operations in the variable @code{vc-cvs-global-switches}. These
+switches are inserted immediately after the @code{cvs} command, before
+the name of the operation to invoke.
+
+
+@node Fortran
+@chapter Fortran Mode
+@cindex Fortran mode
+@cindex mode, Fortran
+
+ Fortran mode provides special motion commands for Fortran statements
+and subprograms, and indentation commands that understand Fortran
+conventions of nesting, line numbers and continuation statements.
+Fortran mode has support for Auto Fill mode that breaks long lines into
+proper Fortran continuation lines.
+
+ Special commands for comments are provided because Fortran comments
+are unlike those of other languages. Built-in abbrevs optionally save
+typing when you insert Fortran keywords.
+
+ Use @kbd{M-x fortran-mode} to switch to this major mode. This
+command runs the hook @code{fortran-mode-hook}. @xref{Hooks,,, emacs,
+the Emacs Manual}.
+
+@cindex Fortran77 and Fortran90
+@findex f90-mode
+@findex fortran-mode
+ Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
+``tab format'') source code. For editing the modern Fortran90 or
+Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
+Emacs normally uses Fortran mode for files with extension @samp{.f},
+@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
+@samp{.f95}. GNU Fortran supports both kinds of format.
+
+@menu
+* Motion: Fortran Motion. Moving point by statements or subprograms.
+* Indent: Fortran Indent. Indentation commands for Fortran.
+* Comments: Fortran Comments. Inserting and aligning comments.
+* Autofill: Fortran Autofill. Auto fill support for Fortran.
+* Columns: Fortran Columns. Measuring columns for valid Fortran.
+* Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords.
+@end menu
+
+@node Fortran Motion
+@section Motion Commands
+
+ In addition to the normal commands for moving by and operating on
+``defuns'' (Fortran subprograms---functions and subroutines, as well as
+modules for F90 mode), Fortran mode provides special commands to move by
+statements and other program units.
+
+@table @kbd
+@kindex C-c C-n @r{(Fortran mode)}
+@findex fortran-next-statement
+@findex f90-next-statement
+@item C-c C-n
+Move to the beginning of the next statement
+(@code{fortran-next-statement}/@code{f90-next-statement}).
+
+@kindex C-c C-p @r{(Fortran mode)}
+@findex fortran-previous-statement
+@findex f90-previous-statement
+@item C-c C-p
+Move to the beginning of the previous statement
+(@code{fortran-previous-statement}/@code{f90-previous-statement}).
+If there is no previous statement (i.e. if called from the first
+statement in the buffer), move to the start of the buffer.
+
+@kindex C-c C-e @r{(F90 mode)}
+@findex f90-next-block
+@item C-c C-e
+Move point forward to the start of the next code block
+(@code{f90-next-block}). A code block is a subroutine,
+@code{if}--@code{endif} statement, and so forth. This command exists
+for F90 mode only, not Fortran mode. With a numeric argument, this
+moves forward that many blocks.
+
+@kindex C-c C-a @r{(F90 mode)}
+@findex f90-previous-block
+@item C-c C-a
+Move point backward to the previous code block
+(@code{f90-previous-block}). This is like @code{f90-next-block}, but
+moves backwards.
+
+@kindex C-M-n @r{(Fortran mode)}
+@findex fortran-end-of-block
+@findex f90-end-of-block
+@item C-M-n
+Move to the end of the current code block
+(@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric
+agument, move forward that number of blocks. The mark is set before
+moving point. The F90 mode version of this command checks for
+consistency of block types and labels (if present), but it does not
+check the outermost block since that may be incomplete.
+
+@kindex C-M-p @r{(Fortran mode)}
+@findex fortran-beginning-of-block
+@findex f90-beginning-of-block
+@item C-M-p
+Move to the start of the current code block
+(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
+is like @code{fortran-end-of-block}, but moves backwards.
+@end table
+
+@node Fortran Indent
+@section Fortran Indentation
+
+ Special commands and features are needed for indenting Fortran code in
+order to make sure various syntactic entities (line numbers, comment line
+indicators and continuation line flags) appear in the columns that are
+required for standard, fixed (or tab) format Fortran.
+
+@menu
+* Commands: ForIndent Commands. Commands for indenting and filling Fortran.
+* Contline: ForIndent Cont. How continuation lines indent.
+* Numbers: ForIndent Num. How line numbers auto-indent.
+* Conv: ForIndent Conv. Conventions you must obey to avoid trouble.
+* Vars: ForIndent Vars. Variables controlling Fortran indent style.
+@end menu
+
+@node ForIndent Commands
+@subsection Fortran Indentation and Filling Commands
+
+@table @kbd
+@item C-M-j
+Break the current line at point and set up a continuation line
+(@code{fortran-split-line}).
+@item M-^
+Join this line to the previous line (@code{fortran-join-line}).
+@item C-M-q
+Indent all the lines of the subprogram point is in
+(@code{fortran-indent-subprogram}).
+@item M-q
+Fill a comment block or statement.
+@end table
+
+@kindex C-M-q @r{(Fortran mode)}
+@findex fortran-indent-subprogram
+ The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
+to reindent all the lines of the Fortran subprogram (function or
+subroutine) containing point.
+
+@kindex C-M-j @r{(Fortran mode)}
+@findex fortran-split-line
+ The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
+a line in the appropriate fashion for Fortran. In a non-comment line,
+the second half becomes a continuation line and is indented
+accordingly. In a comment line, both halves become separate comment
+lines.
+
+@kindex M-^ @r{(Fortran mode)}
+@kindex C-c C-d @r{(Fortran mode)}
+@findex fortran-join-line
+ @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
+which joins a continuation line back to the previous line, roughly as
+the inverse of @code{fortran-split-line}. The point must be on a
+continuation line when this command is invoked.
+
+@kindex M-q @r{(Fortran mode)}
+@kbd{M-q} in Fortran mode fills the comment block or statement that
+point is in. This removes any excess statement continuations.
+
+@node ForIndent Cont
+@subsection Continuation Lines
+@cindex Fortran continuation lines
+
+@vindex fortran-continuation-string
+ Most Fortran77 compilers allow two ways of writing continuation lines.
+If the first non-space character on a line is in column 5, then that
+line is a continuation of the previous line. We call this @dfn{fixed
+format}. (In GNU Emacs we always count columns from 0; but note that
+the Fortran standard counts from 1.) The variable
+@code{fortran-continuation-string} specifies what character to put in
+column 5. A line that starts with a tab character followed by any digit
+except @samp{0} is also a continuation line. We call this style of
+continuation @dfn{tab format}. (Fortran90 introduced ``free format'',
+with another style of continuation lines).
+
+@vindex indent-tabs-mode @r{(Fortran mode)}
+@vindex fortran-analyze-depth
+@vindex fortran-tab-mode-default
+ Fortran mode can use either style of continuation line. When you
+enter Fortran mode, it tries to deduce the proper continuation style
+automatically from the buffer contents. It does this by scanning up to
+@code{fortran-analyze-depth} (default 100) lines from the start of the
+buffer. The first line that begins with either a tab character or six
+spaces determines the choice. If the scan fails (for example, if the
+buffer is new and therefore empty), the value of
+@code{fortran-tab-mode-default} (@code{nil} for fixed format, and
+non-@code{nil} for tab format) is used. @samp{/t} in the mode line
+indicates tab format is selected. Fortran mode sets the value of
+@code{indent-tabs-mode} accordingly.
+
+ If the text on a line starts with the Fortran continuation marker
+@samp{$}, or if it begins with any non-whitespace character in column
+5, Fortran mode treats it as a continuation line. When you indent a
+continuation line with @key{TAB}, it converts the line to the current
+continuation style. When you split a Fortran statement with
+@kbd{C-M-j}, the continuation marker on the newline is created according
+to the continuation style.
+
+ The setting of continuation style affects several other aspects of
+editing in Fortran mode. In fixed format mode, the minimum column
+number for the body of a statement is 6. Lines inside of Fortran
+blocks that are indented to larger column numbers always use only the
+space character for whitespace. In tab format mode, the minimum
+column number for the statement body is 8, and the whitespace before
+column 8 must always consist of one tab character.
+
+@node ForIndent Num
+@subsection Line Numbers
+
+ If a number is the first non-whitespace in the line, Fortran
+indentation assumes it is a line number and moves it to columns 0
+through 4. (Columns always count from 0 in GNU Emacs.)
+
+@vindex fortran-line-number-indent
+ Line numbers of four digits or less are normally indented one space.
+The variable @code{fortran-line-number-indent} controls this; it
+specifies the maximum indentation a line number can have. The default
+value of the variable is 1. Fortran mode tries to prevent line number
+digits passing column 4, reducing the indentation below the specified
+maximum if necessary. If @code{fortran-line-number-indent} has the
+value 5, line numbers are right-justified to end in column 4.
+
+@vindex fortran-electric-line-number
+ Simply inserting a line number is enough to indent it according to
+these rules. As each digit is inserted, the indentation is recomputed.
+To turn off this feature, set the variable
+@code{fortran-electric-line-number} to @code{nil}.
+
+
+@node ForIndent Conv
+@subsection Syntactic Conventions
+
+ Fortran mode assumes that you follow certain conventions that simplify
+the task of understanding a Fortran program well enough to indent it
+properly:
+
+@itemize @bullet
+@item
+Two nested @samp{do} loops never share a @samp{continue} statement.
+
+@item
+Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
+and others are written without embedded whitespace or line breaks.
+
+Fortran compilers generally ignore whitespace outside of string
+constants, but Fortran mode does not recognize these keywords if they
+are not contiguous. Constructs such as @samp{else if} or @samp{end do}
+are acceptable, but the second word should be on the same line as the
+first and not on a continuation line.
+@end itemize
+
+@noindent
+If you fail to follow these conventions, the indentation commands may
+indent some lines unaesthetically. However, a correct Fortran program
+retains its meaning when reindented even if the conventions are not
+followed.
+
+@node ForIndent Vars
+@subsection Variables for Fortran Indentation
+
+@vindex fortran-do-indent
+@vindex fortran-if-indent
+@vindex fortran-structure-indent
+@vindex fortran-continuation-indent
+@vindex fortran-check-all-num@dots{}
+@vindex fortran-minimum-statement-indent@dots{}
+ Several additional variables control how Fortran indentation works:
+
+@table @code
+@item fortran-do-indent
+Extra indentation within each level of @samp{do} statement (default 3).
+
+@item fortran-if-indent
+Extra indentation within each level of @samp{if}, @samp{select case}, or
+@samp{where} statements (default 3).
+
+@item fortran-structure-indent
+Extra indentation within each level of @samp{structure}, @samp{union},
+@samp{map}, or @samp{interface} statements (default 3).
+
+@item fortran-continuation-indent
+Extra indentation for bodies of continuation lines (default 5).
+
+@item fortran-check-all-num-for-matching-do
+In Fortran77, a numbered @samp{do} statement is ended by any statement
+with a matching line number. It is common (but not compulsory) to use a
+@samp{continue} statement for this purpose. If this variable has a
+non-@code{nil} value, indenting any numbered statement must check for a
+@samp{do} that ends there. If you always end @samp{do} statements with
+a @samp{continue} line (or if you use the more modern @samp{enddo}),
+then you can speed up indentation by setting this variable to
+@code{nil}. The default is @code{nil}.
+
+@item fortran-blink-matching-if
+If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
+statement moves the cursor momentarily to the matching @samp{if} (or
+@samp{do}) statement to show where it is. The default is @code{nil}.
+
+@item fortran-minimum-statement-indent-fixed
+Minimum indentation for Fortran statements when using fixed format
+continuation line style. Statement bodies are never indented less than
+this much. The default is 6.
+
+@item fortran-minimum-statement-indent-tab
+Minimum indentation for Fortran statements for tab format continuation line
+style. Statement bodies are never indented less than this much. The
+default is 8.
+@end table
+
+The variables controlling the indentation of comments are described in
+the following section.
+
+@node Fortran Comments
+@section Fortran Comments
+
+ The usual Emacs comment commands assume that a comment can follow a
+line of code. In Fortran77, the standard comment syntax requires an
+entire line to be just a comment. Therefore, Fortran mode replaces the
+standard Emacs comment commands and defines some new variables.
+
+@vindex fortran-comment-line-start
+ Fortran mode can also handle the Fortran90 comment syntax where comments
+start with @samp{!} and can follow other text. Because only some Fortran77
+compilers accept this syntax, Fortran mode will not insert such comments
+unless you have said in advance to do so. To do this, set the variable
+@code{fortran-comment-line-start} to @samp{"!"}.
+
+@table @kbd
+@item M-;
+Align comment or insert new comment (@code{fortran-indent-comment}).
+
+@item C-x ;
+Applies to nonstandard @samp{!} comments only.
+
+@item C-c ;
+Turn all lines of the region into comments, or (with argument) turn them back
+into real code (@code{fortran-comment-region}).
+@end table
+
+@findex fortran-indent-comment
+ @kbd{M-;} in Fortran mode is redefined as the command
+@code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this
+recognizes any kind of existing comment and aligns its text appropriately;
+if there is no existing comment, a comment is inserted and aligned. But
+inserting and aligning comments are not the same in Fortran mode as in
+other modes.
+
+ When a new comment must be inserted, if the current line is blank, a
+full-line comment is inserted. On a non-blank line, a nonstandard @samp{!}
+comment is inserted if you have said you want to use them. Otherwise a
+full-line comment is inserted on a new line before the current line.
+
+ Nonstandard @samp{!} comments are aligned like comments in other
+languages, but full-line comments are different. In a standard full-line
+comment, the comment delimiter itself must always appear in column zero.
+What can be aligned is the text within the comment. You can choose from
+three styles of alignment by setting the variable
+@code{fortran-comment-indent-style} to one of these values:
+
+@vindex fortran-comment-indent-style
+@vindex fortran-comment-line-extra-indent
+@table @code
+@item fixed
+Align the text at a fixed column, which is the sum of
+@code{fortran-comment-line-extra-indent} and the minimum statement
+indentation. This is the default.
+
+The minimum statement indentation is
+@code{fortran-minimum-statement-indent-fixed} for fixed format
+continuation line style and @code{fortran-minimum-statement-indent-tab}
+for tab format style.
+
+@item relative
+Align the text as if it were a line of code, but with an additional
+@code{fortran-comment-line-extra-indent} columns of indentation.
+
+@item nil
+Don't move text in full-line comments automatically.
+@end table
+
+@vindex fortran-comment-indent-char
+ In addition, you can specify the character to be used to indent within
+full-line comments by setting the variable
+@code{fortran-comment-indent-char} to the single-character string you want
+to use.
+
+@vindex fortran-directive-re
+ Compiler directive lines, or preprocessor lines, have much the same
+appearance as comment lines. It is important, though, that such lines
+never be indented at all, no matter what the value of
+@code{fortran-comment-indent-style}. The variable
+@code{fortran-directive-re} is a regular expression that specifies which
+lines are directives. Matching lines are never indented, and receive
+distinctive font-locking.
+
+ The normal Emacs comment command @kbd{C-x ;} has not been redefined. If
+you use @samp{!} comments, this command can be used with them. Otherwise
+it is useless in Fortran mode.
+
+@kindex C-c ; @r{(Fortran mode)}
+@findex fortran-comment-region
+@vindex fortran-comment-region
+ The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
+lines of the region into comments by inserting the string @samp{C$$$} at
+the front of each one. With a numeric argument, it turns the region
+back into live code by deleting @samp{C$$$} from the front of each line
+in it. The string used for these comments can be controlled by setting
+the variable @code{fortran-comment-region}. Note that here we have an
+example of a command and a variable with the same name; these two uses
+of the name never conflict because in Lisp and in Emacs it is always
+clear from the context which one is meant.
+
+@node Fortran Autofill
+@section Auto Fill in Fortran Mode
+
+ Fortran mode has specialized support for Auto Fill mode, which is a
+minor mode that automatically splits statements as you insert them
+when they become too wide. Splitting a statement involves making
+continuation lines using @code{fortran-continuation-string}
+(@pxref{ForIndent Cont}). This splitting happens when you type
+@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran
+indentation commands. You activate Auto Fill in Fortran mode in the
+normal way. @xref{Auto Fill,,, emacs, the Emacs Manual}.
+
+@vindex fortran-break-before-delimiters
+ Auto Fill breaks lines at spaces or delimiters when the lines get
+longer than the desired width (the value of @code{fill-column}). The
+delimiters (besides whitespace) that Auto Fill can break at are
+@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
+and @samp{,}. The line break comes after the delimiter if the
+variable @code{fortran-break-before-delimiters} is @code{nil}.
+Otherwise (and by default), the break comes before the delimiter.
+
+ To enable Auto Fill in all Fortran buffers, add
+@code{turn-on-auto-fill} to @code{fortran-mode-hook}. @xref{Hooks,,,
+emacs, the Emacs Manual}.
+
+@node Fortran Columns
+@section Checking Columns in Fortran
+
+@table @kbd
+@item C-c C-r
+Display a ``column ruler'' momentarily above the current line
+(@code{fortran-column-ruler}).
+@item C-c C-w
+Split the current window horizontally temporarily so that it is 72
+columns wide (@code{fortran-window-create-momentarily}). This may
+help you avoid making lines longer than the 72-character limit that
+some Fortran compilers impose.
+@item C-u C-c C-w
+Split the current window horizontally so that it is 72 columns wide
+(@code{fortran-window-create}). You can then continue editing.
+@item M-x fortran-strip-sequence-nos
+Delete all text in column 72 and beyond.
+@end table
+
+@kindex C-c C-r @r{(Fortran mode)}
+@findex fortran-column-ruler
+ The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
+ruler momentarily above the current line. The comment ruler is two lines
+of text that show you the locations of columns with special significance in
+Fortran programs. Square brackets show the limits of the columns for line
+numbers, and curly brackets show the limits of the columns for the
+statement body. Column numbers appear above them.
+
+ Note that the column numbers count from zero, as always in GNU Emacs.
+As a result, the numbers may be one less than those you are familiar
+with; but the positions they indicate in the line are standard for
+Fortran.
+
+@vindex fortran-column-ruler-fixed
+@vindex fortran-column-ruler-tabs
+ The text used to display the column ruler depends on the value of the
+variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is
+@code{nil}, then the value of the variable
+@code{fortran-column-ruler-fixed} is used as the column ruler.
+Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
+displayed. By changing these variables, you can change the column ruler
+display.
+
+@kindex C-c C-w @r{(Fortran mode)}
+@findex fortran-window-create-momentarily
+ @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
+splits the current window horizontally, making a window 72 columns
+wide, so you can see any lines that are too long. Type a space to
+restore the normal width.
+
+@kindex C-u C-c C-w @r{(Fortran mode)}
+@findex fortran-window-create
+ You can also split the window horizontally and continue editing with
+the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x
+fortran-window-create}). By editing in this window you can
+immediately see when you make a line too wide to be correct Fortran.
+
+@findex fortran-strip-sequence-nos
+ The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
+column 72 and beyond, on all lines in the current buffer. This is the
+easiest way to get rid of old sequence numbers.
+
+@node Fortran Abbrev
+@section Fortran Keyword Abbrevs
+
+ Fortran mode provides many built-in abbrevs for common keywords and
+declarations. These are the same sort of abbrev that you can define
+yourself. To use them, you must turn on Abbrev mode.
+@xref{Abbrevs,,, emacs, the Emacs Manual}.
+
+ The built-in abbrevs are unusual in one way: they all start with a
+semicolon. You cannot normally use semicolon in an abbrev, but Fortran
+mode makes this possible by changing the syntax of semicolon to ``word
+constituent.''
+
+ For example, one built-in Fortran abbrev is @samp{;c} for
+@samp{continue}. If you insert @samp{;c} and then insert a punctuation
+character such as a space or a newline, the @samp{;c} expands automatically
+to @samp{continue}, provided Abbrev mode is enabled.@refill
+
+ Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
+Fortran abbrevs and what they stand for.
+
+
+@node MS-DOS
+@chapter Emacs and MS-DOS
+@cindex MS-DOG
+@cindex MS-DOS peculiarities
+
+ This section briefly describes the peculiarities of using Emacs on
+the MS-DOS ``operating system'' (also known as ``MS-DOG'').
+Information about Emacs and Microsoft's current operating system
+Windows (also known as ``Losedows) is in the main Emacs manual
+(@pxref{Microsoft Systems,,, emacs, the Emacs Manual}).
+
+ If you build Emacs for MS-DOS, the binary will also run on Windows
+3.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS
+application; all of this chapter applies for all of those systems, if
+you use an Emacs that was built for MS-DOS.
+
+ @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
+about Emacs' special handling of text files under MS-DOS (and
+Windows).
+
+@menu
+* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS.
+* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
+* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
+* Files: MS-DOS File Names. File name conventions on MS-DOS.
+* Printing: MS-DOS Printing. Printing specifics on MS-DOS.
+* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
+* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
+@end menu
+
+@node MS-DOS Keyboard
+@section Keyboard Usage on MS-DOS
+
+@kindex DEL @r{(MS-DOS)}
+@kindex BS @r{(MS-DOS)}
+ The key that is called @key{DEL} in Emacs (because that's how it is
+designated on most workstations) is known as @key{BS} (backspace) on a
+PC. That is why the PC-specific terminal initialization remaps the
+@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
+as @kbd{C-d} for the same reasons.
+
+@kindex C-g @r{(MS-DOS)}
+@kindex C-BREAK @r{(MS-DOS)}
+@cindex quitting on MS-DOS
+ Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
+character, just like @kbd{C-g}. This is because Emacs cannot detect
+that you have typed @kbd{C-g} until it is ready for more input. As a
+consequence, you cannot use @kbd{C-g} to stop a running command
+(@pxref{Quitting,,,emacs, the Emacs Manual}). By contrast,
+@kbd{C-@key{BREAK}} @emph{is} detected as soon as you type it (as
+@kbd{C-g} is on other systems), so it can be used to stop a running
+command and for emergency escape (@pxref{Emergency Escape,,,emacs, the
+Emacs Manual}).
+
+@cindex Meta (under MS-DOS)
+@cindex Hyper (under MS-DOS)
+@cindex Super (under MS-DOS)
+@vindex dos-super-key
+@vindex dos-hyper-key
+ The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
+You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
+choose either the right @key{CTRL} key or the right @key{ALT} key by
+setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
+or 2 respectively. If neither @code{dos-super-key} nor
+@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
+also mapped to the @key{META} key. However, if the MS-DOS international
+keyboard support program @file{KEYB.COM} is installed, Emacs will
+@emph{not} map the right @key{ALT} to @key{META}, since it is used for
+accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
+layouts; in this case, you may only use the left @key{ALT} as @key{META}
+key.
+
+@kindex C-j @r{(MS-DOS)}
+@vindex dos-keypad-mode
+ The variable @code{dos-keypad-mode} is a flag variable that controls
+what key codes are returned by keys in the numeric keypad. You can also
+define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
+following line into your @file{_emacs} file:
+
+@smallexample
+;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
+(define-key function-key-map [kp-enter] [?\C-j])
+@end smallexample
+
+@node MS-DOS Mouse
+@section Mouse Usage on MS-DOS
+
+@cindex mouse support under MS-DOS
+ Emacs on MS-DOS supports a mouse (on the default terminal only).
+The mouse commands work as documented, including those that use menus
+and the menu bar (@pxref{Menu Bar,,,emacs, the Emacs Manual}). Scroll
+bars don't work in MS-DOS Emacs. PC mice usually have only two
+buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
+press both of them together, that has the effect of @kbd{Mouse-3}. If
+the mouse does have 3 buttons, Emacs detects that at startup, and all
+the 3 buttons function normally, as on X.
+
+ Help strings for menu-bar and pop-up menus are displayed in the echo
+area when the mouse pointer moves across the menu items. Highlighting
+of mouse-sensitive text (@pxref{Mouse References,,,emacs, the Emacs
+Manual}) is also supported.
+
+@cindex mouse, set number of buttons
+@findex msdos-set-mouse-buttons
+ Some versions of mouse drivers don't report the number of mouse
+buttons correctly. For example, mice with a wheel report that they
+have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
+the wheel, which serves as the middle button, are not passed. In
+these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
+to tell Emacs how many mouse buttons to expect. You could make such a
+setting permanent by adding this fragment to your @file{_emacs} init
+file:
+
+@example
+;; @r{Treat the mouse like a 2-button mouse.}
+(msdos-set-mouse-buttons 2)
+@end example
+
+@cindex Windows clipboard support
+ Emacs built for MS-DOS supports clipboard operations when it runs on
+Windows. Commands that put text on the kill ring, or yank text from
+the ring, check the Windows clipboard first, just as Emacs does on the
+X Window System (@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
+Only the primary selection and the cut buffer are supported by MS-DOS
+Emacs on Windows; the secondary selection always appears as empty.
+
+ Due to the way clipboard access is implemented by Windows, the
+length of text you can put into the clipboard is limited by the amount
+of free DOS memory that is available to Emacs. Usually, up to 620KB of
+text can be put into the clipboard, but this limit depends on the system
+configuration and is lower if you run Emacs as a subprocess of
+another program. If the killed text does not fit, Emacs outputs a
+message saying so, and does not put the text into the clipboard.
+
+ Null characters also cannot be put into the Windows clipboard. If the
+killed text includes null characters, Emacs does not put such text into
+the clipboard, and displays in the echo area a message to that effect.
+
+@vindex dos-display-scancodes
+ The variable @code{dos-display-scancodes}, when non-@code{nil},
+directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
+each keystroke; this feature serves as a complement to the
+@code{view-lossage} command, for debugging.
+
+@node MS-DOS Display
+@section Display on MS-DOS
+@cindex faces under MS-DOS
+@cindex fonts, emulating under MS-DOS
+
+ Display on MS-DOS cannot use font variants, like bold or italic, but
+it does support multiple faces, each of which can specify a foreground
+and a background color. Therefore, you can get the full functionality
+of Emacs packages that use fonts (such as @code{font-lock}, Enriched
+Text mode, and others) by defining the relevant faces to use different
+colors. Use the @code{list-colors-display} command (@pxref{Frame
+Parameters,,,emacs, the Emacs Manual}) and the
+@code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs
+Manual}) to see what colors and faces are available and what they look
+like.
+
+ @xref{MS-DOS and MULE}, later in this chapter, for information on
+how Emacs displays glyphs and characters that aren't supported by the
+native font built into the DOS display.
+
+@cindex cursor shape on MS-DOS
+ When Emacs starts, it changes the cursor shape to a solid box. This
+is for compatibility with other systems, where the box cursor is the
+default in Emacs. This default shape can be changed to a bar by
+specifying the @code{cursor-type} parameter in the variable
+@code{default-frame-alist} (@pxref{Creating Frames,,,emacs, the Emacs
+Manual}). The MS-DOS terminal doesn't support a vertical-bar cursor,
+so the bar cursor is horizontal, and the @code{@var{width}} parameter,
+if specified by the frame parameters, actually determines its height.
+For this reason, the @code{bar} and @code{hbar} cursor types produce
+the same effect on MS-DOS. As an extension, the bar cursor
+specification can include the starting scan line of the cursor as well
+as its width, like this:
+
+@example
+ '(cursor-type bar @var{width} . @var{start})
+@end example
+
+@noindent
+In addition, if the @var{width} parameter is negative, the cursor bar
+begins at the top of the character cell.
+
+@cindex frames on MS-DOS
+ The MS-DOS terminal can only display a single frame at a time. The
+Emacs frame facilities work on MS-DOS much as they do on text-only
+terminals (@pxref{Frames,,,emacs, the Emacs Manual}). When you run
+Emacs from a DOS window on MS-Windows, you can make the visible frame
+smaller than the full screen, but Emacs still cannot display more than
+a single frame at a time.
+
+@cindex frame size under MS-DOS
+@findex mode4350
+@findex mode25
+ The @code{mode4350} command switches the display to 43 or 50
+lines, depending on your hardware; the @code{mode25} command switches
+to the default 80x25 screen size.
+
+ By default, Emacs only knows how to set screen sizes of 80 columns by
+25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has
+special video modes that will switch the display to other sizes, you can
+have Emacs support those too. When you ask Emacs to switch the frame to
+@var{n} rows by @var{m} columns dimensions, it checks if there is a
+variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
+uses its value (which must be an integer) as the video mode to switch
+to. (Emacs switches to that video mode by calling the BIOS @code{Set
+Video Mode} function with the value of
+@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
+For example, suppose your adapter will switch to 66x80 dimensions when
+put into video mode 85. Then you can make Emacs support this screen
+size by putting the following into your @file{_emacs} file:
+
+@example
+(setq screen-dimensions-66x80 85)
+@end example
+
+ Since Emacs on MS-DOS can only set the frame size to specific
+supported dimensions, it cannot honor every possible frame resizing
+request. When an unsupported size is requested, Emacs chooses the next
+larger supported size beyond the specified size. For example, if you
+ask for 36x80 frame, you will get 40x80 instead.
+
+ The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
+when they exactly match the specified size; the search for the next
+larger supported size ignores them. In the above example, even if your
+VGA supports 38x80 dimensions and you define a variable
+@code{screen-dimensions-38x80} with a suitable value, you will still get
+40x80 screen when you ask for a 36x80 frame. If you want to get the
+38x80 size in this case, you can do it by setting the variable named
+@code{screen-dimensions-36x80} with the same video mode value as
+@code{screen-dimensions-38x80}.
+
+ Changing frame dimensions on MS-DOS has the effect of changing all the
+other frames to the new dimensions.
+
+@node MS-DOS File Names
+@section File Names on MS-DOS
+@cindex file names under MS-DOS
+@cindex init file, default name under MS-DOS
+
+ On MS-DOS, file names are case-insensitive and limited to eight
+characters, plus optionally a period and three more characters. Emacs
+knows enough about these limitations to handle file names that were
+meant for other operating systems. For instance, leading dots
+@samp{.} in file names are invalid in MS-DOS, so Emacs transparently
+converts them to underscores @samp{_}; thus your default init file
+(@pxref{Init File,,,emacs, the Emacs Manual}) is called @file{_emacs}
+on MS-DOS. Excess characters before or after the period are generally
+ignored by MS-DOS itself; thus, if you visit the file
+@file{LongFileName.EvenLongerExtension}, you will silently get
+@file{longfile.eve}, but Emacs will still display the long file name
+on the mode line. Other than that, it's up to you to specify file
+names which are valid under MS-DOS; the transparent conversion as
+described above only works on file names built into Emacs.
+
+@cindex backup file names on MS-DOS
+ The above restrictions on the file names on MS-DOS make it almost
+impossible to construct the name of a backup file (@pxref{Backup
+Names,,,emacs, the Emacs Manual}) without losing some of the original
+file name characters. For example, the name of a backup file for
+@file{docs.txt} is @file{docs.tx~} even if single backup is used.
+
+@cindex file names under Windows 95/NT
+@cindex long file names in DOS box under Windows 95/NT
+ If you run Emacs as a DOS application under Windows 9X, Windows ME, or
+Windows 2000, you can turn on support for long file names. If you do
+that, Emacs doesn't truncate file names or convert them to lower case;
+instead, it uses the file names that you specify, verbatim. To enable
+long file name support, set the environment variable @env{LFN} to
+@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow
+DOS programs to access long file names, so Emacs built for MS-DOS will
+only see their short 8+3 aliases.
+
+@cindex @env{HOME} directory under MS-DOS
+ MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
+that the directory where it is installed is the value of the @env{HOME}
+environment variable. That is, if your Emacs binary,
+@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
+Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
+particular, that is where Emacs looks for the init file @file{_emacs}.
+With this in mind, you can use @samp{~} in file names as an alias for
+the home directory, as you would on GNU or Unix. You can also set
+@env{HOME} variable in the environment before starting Emacs; its
+value will then override the above default behavior.
+
+ Emacs on MS-DOS handles the directory name @file{/dev} specially,
+because of a feature in the emulator libraries of DJGPP that pretends
+I/O devices have names in that directory. We recommend that you avoid
+using an actual directory named @file{/dev} on any disk.
+
+@node MS-DOS Printing
+@section Printing and MS-DOS
+
+ Printing commands, such as @code{lpr-buffer}
+(@pxref{Printing,,,emacs, the Emacs Manual}) and
+@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
+can work on MS-DOS by sending the output to one of the printer ports,
+if a Posix-style @code{lpr} program is unavailable. The same Emacs
+variables control printing on all systems, but in some cases they have
+different default values on MS-DOS.
+
+@xref{MS-Windows Printing,,,emacs, the Emacs Manual}, for details.
+
+ Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
+though they are connected to a Windows machine which uses a different
+encoding for the same locale. For example, in the Latin-1 locale, DOS
+uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and
+MULE}. When you print to such printers from Windows, you can use the
+@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
+@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
+codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET
+M-x lpr-region RET} will print the region while converting it to the
+codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
+coding system with @kbd{M-x codepage-setup}.
+
+@vindex dos-printer
+@vindex dos-ps-printer
+ For backwards compatibility, the value of @code{dos-printer}
+(@code{dos-ps-printer}), if it has a value, overrides the value of
+@code{printer-name} (@code{ps-printer-name}), on MS-DOS.
+
+
+@node MS-DOS and MULE
+@section International Support on MS-DOS
+@cindex international support @r{(MS-DOS)}
+
+ Emacs on MS-DOS supports the same international character sets as it
+does on GNU, Unix and other platforms (@pxref{International,,,emacs,
+the Emacs Manual}), including coding systems for converting between
+the different character sets. However, due to incompatibilities
+between MS-DOS/MS-Windows and other systems, there are several
+DOS-specific aspects of this support that you should be aware of.
+This section describes these aspects.
+
+ The description below is largely specific to the MS-DOS port of
+Emacs, especially where it talks about practical implications for
+Emacs users. For other operating systems, see the @file{code-pages.el}
+package, which implements support for MS-DOS- and MS-Windows-specific
+encodings for all platforms other than MS-DOS.
+
+@table @kbd
+@item M-x dos-codepage-setup
+Set up Emacs display and coding systems as appropriate for the current
+DOS codepage.
+
+@item M-x codepage-setup
+Create a coding system for a certain DOS codepage.
+@end table
+
+@cindex codepage, MS-DOS
+@cindex DOS codepages
+ MS-DOS is designed to support one character set of 256 characters at
+any given time, but gives you a variety of character sets to choose
+from. The alternative character sets are known as @dfn{DOS codepages}.
+Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
+characters (codes 128 through 255) vary from one codepage to another.
+Each DOS codepage is identified by a 3-digit number, such as 850, 862,
+etc.
+
+ In contrast to X, which lets you use several fonts at the same time,
+MS-DOS normally doesn't allow use of several codepages in a single
+session. MS-DOS was designed to load a single codepage at system
+startup, and require you to reboot in order to change
+it@footnote{Normally, one particular codepage is burnt into the
+display memory, while other codepages can be installed by modifying
+system configuration files, such as @file{CONFIG.SYS}, and rebooting.
+While there is third-party software that allows changing the codepage
+without rebooting, we describe here how a stock MS-DOS system
+behaves.}. Much the same limitation applies when you run DOS
+executables on other systems such as MS-Windows.
+
+@cindex unibyte operation @r{(MS-DOS)}
+ If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
+(@pxref{Initial Options,,,emacs, the Emacs Manual}), Emacs does not
+perform any conversion of non-@acronym{ASCII} characters. Instead, it
+reads and writes any non-@acronym{ASCII} characters verbatim, and
+sends their 8-bit codes to the display verbatim. Thus, unibyte Emacs
+on MS-DOS supports the current codepage, whatever it may be, but
+cannot even represent any other characters.
+
+@vindex dos-codepage
+ For multibyte operation on MS-DOS, Emacs needs to know which
+characters the chosen DOS codepage can display. So it queries the
+system shortly after startup to get the chosen codepage number, and
+stores the number in the variable @code{dos-codepage}. Some systems
+return the default value 437 for the current codepage, even though the
+actual codepage is different. (This typically happens when you use the
+codepage built into the display hardware.) You can specify a different
+codepage for Emacs to use by setting the variable @code{dos-codepage} in
+your init file.
+
+@cindex language environment, automatic selection on @r{MS-DOS}
+ Multibyte Emacs supports only certain DOS codepages: those which can
+display Far-Eastern scripts, like the Japanese codepage 932, and those
+that encode a single ISO 8859 character set.
+
+ The Far-Eastern codepages can directly display one of the MULE
+character sets for these countries, so Emacs simply sets up to use the
+appropriate terminal coding system that is supported by the codepage.
+The special features described in the rest of this section mostly
+pertain to codepages that encode ISO 8859 character sets.
+
+ For the codepages which correspond to one of the ISO character sets,
+Emacs knows the character set name based on the codepage number. Emacs
+automatically creates a coding system to support reading and writing
+files that use the current codepage, and uses this coding system by
+default. The name of this coding system is @code{cp@var{nnn}}, where
+@var{nnn} is the codepage number.@footnote{The standard Emacs coding
+systems for ISO 8859 are not quite right for the purpose, because
+typically the DOS codepage does not match the standard ISO character
+codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
+code 231 in the standard Latin-1 character set, but the corresponding
+DOS codepage 850 uses code 135 for this glyph.}
+
+@cindex mode line @r{(MS-DOS)}
+ All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
+(for ``DOS'') as their mode-line mnemonic. Since both the terminal
+coding system and the default coding system for file I/O are set to
+the proper @code{cp@var{nnn}} coding system at startup, it is normal
+for the mode line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode
+Line,,,emacs, the Emacs Manual}. Far-Eastern DOS terminals do not use
+the @code{cp@var{nnn}} coding systems, and thus their initial mode
+line looks like the Emacs default.
+
+ Since the codepage number also indicates which script you are using,
+Emacs automatically runs @code{set-language-environment} to select the
+language environment for that script (@pxref{Language
+Environments,,,emacs, the Emacs Manual}).
+
+ If a buffer contains a character belonging to some other ISO 8859
+character set, not the one that the chosen DOS codepage supports, Emacs
+displays it using a sequence of @acronym{ASCII} characters. For example, if the
+current codepage doesn't have a glyph for the letter @samp{@`o} (small
+@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
+the braces serve as a visual indication that this is a single character.
+(This may look awkward for some non-Latin characters, such as those from
+Greek or Hebrew alphabets, but it is still readable by a person who
+knows the language.) Even though the character may occupy several
+columns on the screen, it is really still just a single character, and
+all Emacs commands treat it as one.
+
+@cindex IBM graphics characters (MS-DOS)
+@cindex box-drawing characters (MS-DOS)
+@cindex line-drawing characters (MS-DOS)
+ Not all characters in DOS codepages correspond to ISO 8859
+characters---some are used for other purposes, such as box-drawing
+characters and other graphics. Emacs maps these characters to two
+special character sets called @code{eight-bit-control} and
+@code{eight-bit-graphic}, and displays them as their IBM glyphs.
+However, you should be aware that other systems might display these
+characters differently, so you should avoid them in text that might be
+copied to a different operating system, or even to another DOS machine
+that uses a different codepage.
+
+@vindex dos-unsupported-character-glyph
+ Emacs supports many other characters sets aside from ISO 8859, but it
+cannot display them on MS-DOS. So if one of these multibyte characters
+appears in a buffer, Emacs on MS-DOS displays them as specified by the
+@code{dos-unsupported-character-glyph} variable; by default, this glyph
+is an empty triangle. Use the @kbd{C-u C-x =} command to display the
+actual code and character set of such characters. @xref{Position
+Info,,,emacs, the Emacs Manual}.
+
+@findex codepage-setup
+ By default, Emacs defines a coding system to support the current
+codepage. To define a coding system for some other codepage (e.g., to
+visit a file written on a DOS machine in another country), use the
+@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of
+the codepage, with completion, then creates the coding system for the
+specified codepage. You can then use the new coding system to read and
+write files, but you must specify it explicitly for the file command
+when you want to use it (@pxref{Text Coding,,,emacs, the Emacs Manual}).
+
+ These coding systems are also useful for visiting a file encoded using
+a DOS codepage, using Emacs running on some other operating system.
+
+@cindex MS-Windows codepages
+ MS-Windows provides its own codepages, which are different from the
+DOS codepages for the same locale. For example, DOS codepage 850
+supports the same character set as Windows codepage 1252; DOS codepage
+855 supports the same character set as Windows codepage 1251, etc.
+The MS-Windows version of Emacs uses the current codepage for display
+when invoked with the @samp{-nw} option. Support for codepages in the
+Windows port of Emacs is part of the @file{code-pages.el} package.
+
+@node MS-DOS Processes
+@section Subprocesses on MS-DOS
+
+@cindex compilation under MS-DOS
+@cindex inferior processes under MS-DOS
+@findex compile @r{(MS-DOS)}
+@findex grep @r{(MS-DOS)}
+ Because MS-DOS is a single-process ``operating system,''
+asynchronous subprocesses are not available. In particular, Shell
+mode and its variants do not work. Most Emacs features that use
+asynchronous subprocesses also don't work on MS-DOS, including
+Shell mode and GUD. When in doubt, try and see; commands that
+don't work output an error message saying that asynchronous processes
+aren't supported.
+
+ Compilation under Emacs with @kbd{M-x compile}, searching files with
+@kbd{M-x grep} and displaying differences between files with @kbd{M-x
+diff} do work, by running the inferior processes synchronously. This
+means you cannot do any more editing until the inferior process
+finishes.
+
+ Spell checking also works, by means of special support for synchronous
+invocation of the @code{ispell} program. This is slower than the
+asynchronous invocation on other platforms
+
+ Instead of the Shell mode, which doesn't work on MS-DOS, you can use
+the @kbd{M-x eshell} command. This invokes the Eshell package that
+implements a Posix-like shell entirely in Emacs Lisp.
+
+ By contrast, Emacs compiled as a native Windows application
+@strong{does} support asynchronous subprocesses. @xref{Windows
+Processes,,,emacs, the Emacs Manual}.
+
+@cindex printing under MS-DOS
+ Printing commands, such as @code{lpr-buffer}
+(@pxref{Printing,,,emacs, the Emacs Manual}) and
+@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
+work in MS-DOS by sending the output to one of the printer ports.
+@xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
+
+ When you run a subprocess synchronously on MS-DOS, make sure the
+program terminates and does not try to read keyboard input. If the
+program does not terminate on its own, you will be unable to terminate
+it, because MS-DOS provides no general way to terminate a process.
+Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
+cases.
+
+ Accessing files on other machines is not supported on MS-DOS. Other
+network-oriented commands such as sending mail, Web browsing, remote
+login, etc., don't work either, unless network access is built into
+MS-DOS with some network redirector.
+
+@cindex directory listing on MS-DOS
+@vindex dired-listing-switches @r{(MS-DOS)}
+ Dired on MS-DOS uses the @code{ls-lisp} package where other
+platforms use the system @code{ls} command. Therefore, Dired on
+MS-DOS supports only some of the possible options you can mention in
+the @code{dired-listing-switches} variable. The options that work are
+@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
+@samp{-s}, @samp{-t}, and @samp{-u}.
+