emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/man/emacs-xtra.texi


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/man/emacs-xtra.texi
Date: Thu, 16 Mar 2006 03:19:57 +0000

Index: emacs/man/emacs-xtra.texi
diff -u emacs/man/emacs-xtra.texi:1.13 emacs/man/emacs-xtra.texi:1.14
--- emacs/man/emacs-xtra.texi:1.13      Sun Feb  5 22:41:30 2006
+++ emacs/man/emacs-xtra.texi   Thu Mar 16 03:19:56 2006
@@ -59,6 +59,10 @@
 * Autorevert::                    Auto Reverting non-file buffers.
 * Subdir switches::               Subdirectory switches in Dired.
 * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
+* Emerge::                        A convenient way of merging two versions of 
a program.
+* Picture Mode::                  Editing pictures made up of characters
+                                    using the quarter-plane screen model.
+* Fortran::                       Fortran mode and its special features.
 * Index::
 @end menu
 
@@ -1222,6 +1226,1184 @@
 If one of these functions decides that it applies to a certain date,
 it returns a value that contains @var{mark}.
 
address@hidden Emerge
address@hidden Merging Files with Emerge
address@hidden Emerge
address@hidden merging files
+
+  It's not unusual for programmers to get their signals crossed and
+modify the same program in two different directions.  To recover from
+this confusion, you need to merge the two versions.  Emerge makes this
+easier.  For other ways to compare files, see @ref{Comparing Files,,,
+emacs, the Emacs Manual} and @ref{Top, Ediff,, ediff, The Ediff
+Manual}.
+
address@hidden
+* Overview of Emerge:: How to start Emerge.  Basic concepts.
+* Submodes of Emerge:: Fast mode vs. Edit mode.
+                         Skip Prefers mode and Auto Advance mode.
+* State of Difference::        You do the merge by specifying state A or B
+                         for each difference.
+* Merge Commands::     Commands for selecting a difference,
+                         changing states of differences, etc.
+* Exiting Emerge::     What to do when you've finished the merge.
+* Combining in Emerge::            How to keep both alternatives for a 
difference.
+* Fine Points of Emerge::   Misc.
address@hidden menu
+
address@hidden Overview of Emerge
address@hidden Overview of Emerge
+
+  To start Emerge, run one of these four commands:
+
address@hidden @kbd
address@hidden M-x emerge-files
address@hidden emerge-files
+Merge two specified files.
+
address@hidden M-x emerge-files-with-ancestor
address@hidden emerge-files-with-ancestor
+Merge two specified files, with reference to a common ancestor.
+
address@hidden M-x emerge-buffers
address@hidden emerge-buffers
+Merge two buffers.
+
address@hidden M-x emerge-buffers-with-ancestor
address@hidden emerge-buffers-with-ancestor
+Merge two buffers with reference to a common ancestor in a third
+buffer.
address@hidden table
+
address@hidden merge buffer (Emerge)
address@hidden A and B buffers (Emerge)
+  The Emerge commands compare two files or buffers, and display the
+comparison in three buffers: one for each input text (the @dfn{A buffer}
+and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging
+takes place.  The merge buffer shows the full merged text, not just the
+differences.  Wherever the two input texts differ, you can choose which
+one of them to include in the merge buffer.
+
+  The Emerge commands that take input from existing buffers use only
+the accessible portions of those buffers, if they are narrowed.
address@hidden,,, emacs, the Emacs Manual}.
+
+
+  If a common ancestor version is available, from which the two texts to
+be merged were both derived, Emerge can use it to guess which
+alternative is right.  Wherever one current version agrees with the
+ancestor, Emerge presumes that the other current version is a deliberate
+change which should be kept in the merged version.  Use the
address@hidden commands if you want to specify a common ancestor
+text.  These commands read three file or buffer names---variant A,
+variant B, and the common ancestor.
+
+  After the comparison is done and the buffers are prepared, the
+interactive merging starts.  You control the merging by typing special
address@hidden commands} in the merge buffer (@pxref{Merge Commands}).
+For each run of differences between the input texts, you can choose
+which one of them to keep, or edit them both together.
+
+  The merge buffer uses a special major mode, Emerge mode, with commands
+for making these choices.  But you can also edit the buffer with
+ordinary Emacs commands.
+
+  At any given time, the attention of Emerge is focused on one
+particular difference, called the @dfn{selected} difference.  This
+difference is marked off in the three buffers like this:
+
address@hidden
+vvvvvvvvvvvvvvvvvvvv
address@hidden that differs}
+^^^^^^^^^^^^^^^^^^^^
address@hidden example
+
address@hidden
+Emerge numbers all the differences sequentially and the mode
+line always shows the number of the selected difference.
+
+  Normally, the merge buffer starts out with the A version of the text.
+But when the A version of a difference agrees with the common ancestor,
+then the B version is initially preferred for that difference.
+
+  Emerge leaves the merged text in the merge buffer when you exit.  At
+that point, you can save it in a file with @kbd{C-x C-w}.  If you give a
+numeric argument to @code{emerge-files} or
address@hidden, it reads the name of the output file
+using the minibuffer.  (This is the last file name those commands read.)
+Then exiting from Emerge saves the merged text in the output file.
+
+  Normally, Emerge commands save the output buffer in its file when you
+exit.  If you abort Emerge with @kbd{C-]}, the Emerge command does not
+save the output buffer, but you can save it yourself if you wish.
+
address@hidden Submodes of Emerge
address@hidden Submodes of Emerge
+
+  You can choose between two modes for giving merge commands: Fast mode
+and Edit mode.  In Fast mode, basic merge commands are single
+characters, but ordinary Emacs commands are disabled.  This is
+convenient if you use only merge commands.  In Edit mode, all merge
+commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs
+commands are also available.  This allows editing the merge buffer, but
+slows down Emerge operations.
+
+  Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to
+Fast mode.  The mode line indicates Edit and Fast modes with @samp{E}
+and @samp{F}.
+
+  Emerge has two additional submodes that affect how particular merge
+commands work: Auto Advance mode and Skip Prefers mode.
+
+  If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands
+advance to the next difference.  This lets you go through the merge
+faster as long as you simply choose one of the alternatives from the
+input.  The mode line indicates Auto Advance mode with @samp{A}.
+
+  If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands
+skip over differences in states prefer-A and prefer-B (@pxref{State of
+Difference}).  Thus you see only differences for which neither version
+is presumed ``correct.''  The mode line indicates Skip Prefers mode with
address@hidden
+
address@hidden emerge-auto-advance-mode
address@hidden emerge-skip-prefers-mode
+  Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or
+clear Auto Advance mode.  Use @kbd{s s}
+(@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode.
+These commands turn on the mode with a positive argument, turns it off
+with a negative or zero argument, and toggle the mode with no argument.
+
address@hidden State of Difference
address@hidden State of a Difference
+
+  In the merge buffer, a difference is marked with lines of @samp{v} and
address@hidden characters.  Each difference has one of these seven states:
+
address@hidden @asis
address@hidden A
+The difference is showing the A version.  The @kbd{a} command always
+produces this state; the mode line indicates it with @samp{A}.
+
address@hidden B
+The difference is showing the B version.  The @kbd{b} command always
+produces this state; the mode line indicates it with @samp{B}.
+
address@hidden default-A
address@hidden default-B
+The difference is showing the A or the B state by default, because you
+haven't made a choice.  All differences start in the default-A state
+(and thus the merge buffer is a copy of the A buffer), except those for
+which one alternative is ``preferred'' (see below).
+
+When you select a difference, its state changes from default-A or
+default-B to plain A or B.  Thus, the selected difference never has
+state default-A or default-B, and these states are never displayed in
+the mode line.
+
+The command @kbd{d a} chooses default-A as the default state, and @kbd{d
+b} chooses default-B.  This chosen default applies to all differences
+which you haven't ever selected and for which no alternative is preferred.
+If you are moving through the merge sequentially, the differences you
+haven't selected are those following the selected one.  Thus, while
+moving sequentially, you can effectively make the A version the default
+for some sections of the merge buffer and the B version the default for
+others by using @kbd{d a} and @kbd{d b} between sections.
+
address@hidden prefer-A
address@hidden prefer-B
+The difference is showing the A or B state because it is
address@hidden  This means that you haven't made an explicit choice,
+but one alternative seems likely to be right because the other
+alternative agrees with the common ancestor.  Thus, where the A buffer
+agrees with the common ancestor, the B version is preferred, because
+chances are it is the one that was actually changed.
+
+These two states are displayed in the mode line as @samp{A*} and @samp{B*}.
+
address@hidden combined
+The difference is showing a combination of the A and B states, as a
+result of the @kbd{x c} or @kbd{x C} commands.
+
+Once a difference is in this state, the @kbd{a} and @kbd{b} commands
+don't do anything to it unless you give them a numeric argument.
+
+The mode line displays this state as @samp{comb}.
address@hidden table
+
address@hidden Merge Commands
address@hidden Merge Commands
+
+  Here are the Merge commands for Fast mode; in Edit mode, precede them
+with @kbd{C-c C-c}:
+
address@hidden @kbd
address@hidden p
+Select the previous difference.
+
address@hidden n
+Select the next difference.
+
address@hidden a
+Choose the A version of this difference.
+
address@hidden b
+Choose the B version of this difference.
+
address@hidden C-u @var{n} j
+Select difference number @var{n}.
+
address@hidden .
+Select the difference containing point.  You can use this command in the
+merge buffer or in the A or B buffer.
+
address@hidden q
+Quit---finish the merge.
+
address@hidden C-]
+Abort---exit merging and do not save the output.
+
address@hidden f
+Go into Fast mode.  (In Edit mode, this is actually @kbd{C-c C-c f}.)
+
address@hidden e
+Go into Edit mode.
+
address@hidden l
+Recenter (like @kbd{C-l}) all three windows.
+
address@hidden -
+Specify part of a prefix numeric argument.
+
address@hidden @var{digit}
+Also specify part of a prefix numeric argument.
+
address@hidden d a
+Choose the A version as the default from here down in
+the merge buffer.
+
address@hidden d b
+Choose the B version as the default from here down in
+the merge buffer.
+
address@hidden c a
+Copy the A version of this difference into the kill ring.
+
address@hidden c b
+Copy the B version of this difference into the kill ring.
+
address@hidden i a
+Insert the A version of this difference at point.
+
address@hidden i b
+Insert the B version of this difference at point.
+
address@hidden m
+Put point and mark around the difference.
+
address@hidden ^
+Scroll all three windows down (like @kbd{M-v}).
+
address@hidden v
+Scroll all three windows up (like @kbd{C-v}).
+
address@hidden <
+Scroll all three windows left (like @kbd{C-x <}).
+
address@hidden >
+Scroll all three windows right (like @kbd{C-x >}).
+
address@hidden |
+Reset horizontal scroll on all three windows.
+
address@hidden x 1
+Shrink the merge window to one line.  (Use @kbd{C-u l} to restore it
+to full size.)
+
address@hidden x c
+Combine the two versions of this difference (@pxref{Combining in
+Emerge}).
+
address@hidden x f
+Show the names of the files/buffers Emerge is operating on, in a Help
+window.  (Use @kbd{C-u l} to restore windows.)
+
address@hidden x j
+Join this difference with the following one.
+(@kbd{C-u x j} joins this difference with the previous one.)
+
address@hidden x s
+Split this difference into two differences.  Before you use this
+command, position point in each of the three buffers at the place where
+you want to split the difference.
+
address@hidden x t
+Trim identical lines off the top and bottom of the difference.
+Such lines occur when the A and B versions are
+identical but differ from the ancestor version.
address@hidden table
+
address@hidden Exiting Emerge
address@hidden Exiting Emerge
+
+  The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing
+the results into the output file if you specified one.  It restores the
+A and B buffers to their proper contents, or kills them if they were
+created by Emerge and you haven't changed them.  It also disables the
+Emerge commands in the merge buffer, since executing them later could
+damage the contents of the various buffers.
+
+  @kbd{C-]} aborts the merge.  This means exiting without writing the
+output file.  If you didn't specify an output file, then there is no
+real difference between aborting and finishing the merge.
+
+  If the Emerge command was called from another Lisp program, then its
+return value is @code{t} for successful completion, or @code{nil} if you
+abort.
+
address@hidden Combining in Emerge
address@hidden Combining the Two Versions
+
+  Sometimes you want to keep @emph{both} alternatives for a particular
+difference.  To do this, use @kbd{x c}, which edits the merge buffer
+like this:
+
address@hidden
address@hidden
+#ifdef NEW
address@hidden from A buffer}
+#else /* not NEW */
address@hidden from B buffer}
+#endif /* not NEW */
address@hidden group
address@hidden example
+
address@hidden
address@hidden emerge-combine-versions-template
+While this example shows C preprocessor conditionals delimiting the two
+alternative versions, you can specify the strings to use by setting
+the variable @code{emerge-combine-versions-template} to a string of your
+choice.  In the string, @samp{%a} says where to put version A, and
address@hidden says where to put version B.  The default setting, which
+produces the results shown above, looks like this:
+
address@hidden
address@hidden
+"#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n"
address@hidden group
address@hidden example
+
address@hidden Fine Points of Emerge
address@hidden Fine Points of Emerge
+
+  During the merge, you mustn't try to edit the A and B buffers yourself.
+Emerge modifies them temporarily, but ultimately puts them back the way
+they were.
+
+  You can have any number of merges going at once---just don't use any one
+buffer as input to more than one merge at once, since the temporary
+changes made in these buffers would get in each other's way.
+
+  Starting Emerge can take a long time because it needs to compare the
+files fully.  Emacs can't do anything else until @code{diff} finishes.
+Perhaps in the future someone will change Emerge to do the comparison in
+the background when the input files are large---then you could keep on
+doing other things with Emacs until Emerge is ready to accept
+commands.
+
address@hidden emerge-startup-hook
+  After setting up the merge, Emerge runs the hook
address@hidden  @xref{Hooks,,, emacs, the Emacs Manual}.
+
address@hidden Picture Mode
address@hidden Editing Pictures
address@hidden pictures
address@hidden making pictures out of text characters
address@hidden edit-picture
+
+  To edit a picture made out of text characters (for example, a picture
+of the division of a register into fields, as a comment in a program),
+use the command @kbd{M-x edit-picture} to enter Picture mode.
+
+  In Picture mode, editing is based on the @dfn{quarter-plane} model of
+text, according to which the text characters lie studded on an area that
+stretches infinitely far to the right and downward.  The concept of the end
+of a line does not exist in this model; the most you can say is where the
+last nonblank character on the line is found.
+
+  Of course, Emacs really always considers text as a sequence of
+characters, and lines really do have ends.  But Picture mode replaces
+the most frequently-used commands with variants that simulate the
+quarter-plane model of text.  They do this by inserting spaces or by
+converting tabs to spaces.
+
+  Most of the basic editing commands of Emacs are redefined by Picture mode
+to do essentially the same thing but in a quarter-plane way.  In addition,
+Picture mode defines various keys starting with the @kbd{C-c} prefix to
+run special picture editing commands.
+
+  One of these keys, @kbd{C-c C-c}, is particularly important.  Often a
+picture is part of a larger file that is usually edited in some other
+major mode.  @kbd{M-x edit-picture} records the name of the previous
+major mode so you can use the @kbd{C-c C-c} command
+(@code{picture-mode-exit}) later to go back to that mode.  @kbd{C-c C-c}
+also deletes spaces from the ends of lines, unless given a numeric
+argument.
+
+  The special commands of Picture mode all work in other modes (provided
+the @file{picture} library is loaded), but are not bound to keys except
+in Picture mode.  The descriptions below talk of moving ``one column''
+and so on, but all the picture mode commands handle numeric arguments as
+their normal equivalents do.
+
address@hidden picture-mode-hook
+  Turning on Picture mode runs the hook @code{picture-mode-hook}.
+Additional extensions to Picture mode can be found in
address@hidden
+
address@hidden
+* Basic Picture::         Basic concepts and simple commands of Picture Mode.
+* Insert in Picture::     Controlling direction of cursor motion
+                            after "self-inserting" characters.
+* Tabs in Picture::       Various features for tab stops and indentation.
+* Rectangles in Picture:: Clearing and superimposing rectangles.
address@hidden menu
+
address@hidden Basic Picture
address@hidden Basic Editing in Picture Mode
+
address@hidden picture-forward-column
address@hidden picture-backward-column
address@hidden picture-move-down
address@hidden picture-move-up
address@hidden editing in Picture mode
+
+  Most keys do the same thing in Picture mode that they usually do, but
+do it in a quarter-plane style.  For example, @kbd{C-f} is rebound to
+run @code{picture-forward-column}, a command which moves point one
+column to the right, inserting a space if necessary so that the actual
+end of the line makes no difference.  @kbd{C-b} is rebound to run
address@hidden, which always moves point left one
+column, converting a tab to multiple spaces if necessary.  @kbd{C-n} and
address@hidden are rebound to run @code{picture-move-down} and
address@hidden, which can either insert spaces or convert tabs
+as necessary to make sure that point stays in exactly the same column.
address@hidden runs @code{picture-end-of-line}, which moves to after the last
+nonblank character on the line.  There is no need to change @kbd{C-a},
+as the choice of screen model does not affect beginnings of
+lines.
+
address@hidden picture-newline
+  Insertion of text is adapted to the quarter-plane screen model
+through the use of Overwrite mode (@pxref{Minor Modes,,, emacs, the
+Emacs Manual}.)  Self-inserting characters replace existing text,
+column by column, rather than pushing existing text to the right.
address@hidden runs @code{picture-newline}, which just moves to the
+beginning of the following line so that new text will replace that
+line.
+
address@hidden picture-backward-clear-column
address@hidden picture-clear-column
address@hidden picture-clear-line
+  In Picture mode, the commands that normally delete or kill text,
+instead erase text (replacing it with spaces).  @key{DEL}
+(@code{picture-backward-clear-column}) replaces the preceding
+character with a space rather than removing it; this moves point
+backwards.  @kbd{C-d} (@code{picture-clear-column}) replaces the next
+character or characters with spaces, but does not move point.  (If you
+want to clear characters to spaces and move forward over them, use
address@hidden)  @kbd{C-k} (@code{picture-clear-line}) really kills the
+contents of lines, but does not delete the newlines from the buffer.
+
address@hidden picture-open-line
+  To do actual insertion, you must use special commands.  @kbd{C-o}
+(@code{picture-open-line}) creates a blank line after the current
+line; it never splits a line.  @kbd{C-M-o} (@code{split-line}) makes
+sense in Picture mode, so it is not changed.  @kbd{C-j}
+(@code{picture-duplicate-line}) inserts another line with the same
+contents below the current line.
+
address@hidden C-c C-d @r{(Picture mode)}
+   To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d}
+(which is defined as @code{delete-char}, as @kbd{C-d} is in other
+modes), or one of the picture rectangle commands (@pxref{Rectangles in
+Picture}).
+
address@hidden Insert in Picture
address@hidden Controlling Motion after Insert
+
address@hidden picture-movement-up
address@hidden picture-movement-down
address@hidden picture-movement-left
address@hidden picture-movement-right
address@hidden picture-movement-nw
address@hidden picture-movement-ne
address@hidden picture-movement-sw
address@hidden picture-movement-se
address@hidden C-c < @r{(Picture mode)}
address@hidden C-c > @r{(Picture mode)}
address@hidden C-c ^ @r{(Picture mode)}
address@hidden C-c . @r{(Picture mode)}
address@hidden C-c ` @r{(Picture mode)}
address@hidden C-c ' @r{(Picture mode)}
address@hidden C-c / @r{(Picture mode)}
address@hidden C-c \ @r{(Picture mode)}
+  Since ``self-inserting'' characters in Picture mode overwrite and move
+point, there is no essential restriction on how point should be moved.
+Normally point moves right, but you can specify any of the eight
+orthogonal or diagonal directions for motion after a ``self-inserting''
+character.  This is useful for drawing lines in the buffer.
+
address@hidden @kbd
address@hidden C-c <
address@hidden C-c @key{LEFT}
+Move left after insertion (@code{picture-movement-left}).
address@hidden C-c >
address@hidden C-c @key{RIGHT}
+Move right after insertion (@code{picture-movement-right}).
address@hidden C-c ^
address@hidden C-c @key{UP}
+Move up after insertion (@code{picture-movement-up}).
address@hidden C-c .
address@hidden C-c @key{DOWN}
+Move down after insertion (@code{picture-movement-down}).
address@hidden C-c `
address@hidden C-c @key{HOME}
+Move up and left (``northwest'') after insertion (@code{picture-movement-nw}).
address@hidden C-c '
address@hidden C-c @key{PAGEUP}
+Move up and right (``northeast'') after insertion
+(@code{picture-movement-ne}).
address@hidden C-c /
address@hidden C-c @key{END}
+Move down and left (``southwest'') after insertion
address@hidden(@code{picture-movement-sw}).
address@hidden C-c \
address@hidden C-c @key{PAGEDOWN}
+Move down and right (``southeast'') after insertion
address@hidden(@code{picture-movement-se}).
address@hidden table
+
address@hidden C-c C-f @r{(Picture mode)}
address@hidden C-c C-b @r{(Picture mode)}
address@hidden picture-motion
address@hidden picture-motion-reverse
+  Two motion commands move based on the current Picture insertion
+direction.  The command @kbd{C-c C-f} (@code{picture-motion}) moves in the
+same direction as motion after ``insertion'' currently does, while @kbd{C-c
+C-b} (@code{picture-motion-reverse}) moves in the opposite direction.
+
address@hidden Tabs in Picture
address@hidden Picture Mode Tabs
+
address@hidden M-TAB @r{(Picture mode)}
address@hidden picture-tab-search
address@hidden picture-tab-chars
+  Two kinds of tab-like action are provided in Picture mode.  Use
address@hidden@key{TAB}} (@code{picture-tab-search}) for context-based tabbing.
+With no argument, it moves to a point underneath the next
+``interesting'' character that follows whitespace in the previous
+nonblank line.  ``Next'' here means ``appearing at a horizontal position
+greater than the one point starts out at.''  With an argument, as in
address@hidden address@hidden, this command moves to the next such interesting
+character in the current line.  @address@hidden does not change the
+text; it only moves point.  ``Interesting'' characters are defined by
+the variable @code{picture-tab-chars}, which should define a set of
+characters.  The syntax for this variable is like the syntax used inside
+of @address@hidden in a regular expression---but without the @samp{[}
+and the @samp{]}.  Its default value is @code{"!-~"}.
+
address@hidden picture-tab
+  @key{TAB} itself runs @code{picture-tab}, which operates based on the
+current tab stop settings; it is the Picture mode equivalent of
address@hidden  Normally it just moves point, but with a numeric
+argument it clears the text that it moves over.
+
address@hidden C-c TAB @r{(Picture mode)}
address@hidden picture-set-tab-stops
+  The context-based and tab-stop-based forms of tabbing are brought
+together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}).
+This command sets the tab stops to the positions which @address@hidden
+would consider significant in the current line.  The use of this command,
+together with @key{TAB}, can get the effect of context-based tabbing.  But
address@hidden@key{TAB}} is more convenient in the cases where it is sufficient.
+
+  It may be convenient to prevent use of actual tab characters in
+pictures.  For example, this prevents @kbd{C-x @key{TAB}} from messing
+up the picture.  You can do this by setting the variable
address@hidden to @code{nil}.
+
address@hidden Rectangles in Picture
address@hidden Picture Mode Rectangle Commands
address@hidden rectangles and Picture mode
address@hidden Picture mode and rectangles
+
+  Picture mode defines commands for working on rectangular pieces of
+the text in ways that fit with the quarter-plane model.  The standard
+rectangle commands may also be useful.  @xref{Rectangles,,, emacs, the
+Emacs Manual}.
+
address@hidden @kbd
address@hidden C-c C-k
+Clear out the region-rectangle with spaces
+(@code{picture-clear-rectangle}).  With argument, delete the text.
address@hidden C-c C-w @var{r}
+Similar, but save rectangle contents in register @var{r} first
+(@code{picture-clear-rectangle-to-register}).
address@hidden C-c C-y
+Copy last killed rectangle into the buffer by overwriting, with upper
+left corner at point (@code{picture-yank-rectangle}).  With argument,
+insert instead.
address@hidden C-c C-x @var{r}
+Similar, but use the rectangle in register @var{r}
+(@code{picture-yank-rectangle-from-register}).
address@hidden table
+
address@hidden C-c C-k @r{(Picture mode)}
address@hidden C-c C-w @r{(Picture mode)}
address@hidden picture-clear-rectangle
address@hidden picture-clear-rectangle-to-register
+  The picture rectangle commands @kbd{C-c C-k}
+(@code{picture-clear-rectangle}) and @kbd{C-c C-w}
+(@code{picture-clear-rectangle-to-register}) differ from the standard
+rectangle commands in that they normally clear the rectangle instead of
+deleting it; this is analogous with the way @kbd{C-d} is changed in Picture
+mode.
+
+  However, deletion of rectangles can be useful in Picture mode, so
+these commands delete the rectangle if given a numeric argument.
address@hidden C-k} either with or without a numeric argument saves the
+rectangle for @kbd{C-c C-y}.
+
address@hidden C-c C-y @r{(Picture mode)}
address@hidden C-c C-x @r{(Picture mode)}
address@hidden picture-yank-rectangle
address@hidden picture-yank-rectangle-from-register
+  The Picture mode commands for yanking rectangles differ from the
+standard ones in that they overwrite instead of inserting.  This is
+the same way that Picture mode insertion of other text differs from
+other modes.  @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts
+(by overwriting) the rectangle that was most recently killed, while
address@hidden C-x} (@code{picture-yank-rectangle-from-register}) does
+likewise for the rectangle found in a specified register.
+
address@hidden Fortran
address@hidden Fortran Mode
address@hidden Fortran mode
address@hidden 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}.
+
address@hidden Fortran77 and Fortran90
address@hidden f90-mode
address@hidden 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},
address@hidden or @samp{.for}, and F90 mode for the extension @samp{.f90} and
address@hidden  GNU Fortran supports both kinds of format.
+
address@hidden
+* 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.
address@hidden menu
+
address@hidden Fortran Motion
address@hidden 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.
+
address@hidden @kbd
address@hidden C-c C-n @r{(Fortran mode)}
address@hidden fortran-next-statement
address@hidden f90-next-statement
address@hidden C-c C-n
+Move to the beginning of the next statement
+(@code{fortran-next-statement}/@code{f90-next-statement}).
+
address@hidden C-c C-p @r{(Fortran mode)}
address@hidden fortran-previous-statement
address@hidden f90-previous-statement
address@hidden 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.
+
address@hidden C-c C-e @r{(F90 mode)}
address@hidden f90-next-block
address@hidden 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,
address@hidden@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.
+
address@hidden C-c C-a @r{(F90 mode)}
address@hidden f90-previous-block
address@hidden 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.
+
address@hidden C-M-n @r{(Fortran mode)}
address@hidden fortran-end-of-block
address@hidden f90-end-of-block
address@hidden 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.
+
address@hidden C-M-p @r{(Fortran mode)}
address@hidden fortran-beginning-of-block
address@hidden f90-beginning-of-block
address@hidden 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.
address@hidden table
+
address@hidden Fortran Indent
address@hidden 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.
+
address@hidden
+* 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.
address@hidden menu
+
address@hidden ForIndent Commands
address@hidden Fortran Indentation and Filling Commands
+
address@hidden @kbd
address@hidden C-M-j
+Break the current line at point and set up a continuation line
+(@code{fortran-split-line}).
address@hidden M-^
+Join this line to the previous line (@code{fortran-join-line}).
address@hidden C-M-q
+Indent all the lines of the subprogram point is in
+(@code{fortran-indent-subprogram}).
address@hidden M-q
+Fill a comment block or statement.
address@hidden table
+
address@hidden C-M-q @r{(Fortran mode)}
address@hidden 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.
+
address@hidden C-M-j @r{(Fortran mode)}
address@hidden 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.
+
address@hidden M-^ @r{(Fortran mode)}
address@hidden C-c C-d @r{(Fortran mode)}
address@hidden 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.
+
address@hidden M-q @r{(Fortran mode)}
address@hidden in Fortran mode fills the comment block or statement that
+point is in.  This removes any excess statement continuations.
+
address@hidden ForIndent Cont
address@hidden Continuation Lines
address@hidden Fortran continuation lines
+
address@hidden 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
address@hidden 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).
+
address@hidden indent-tabs-mode @r{(Fortran mode)}
address@hidden fortran-analyze-depth
address@hidden 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
address@hidden (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
address@hidden (@code{nil} for fixed format, and
address@hidden for tab format) is used.  @samp{/t} in the mode line
+indicates tab format is selected.  Fortran mode sets the value of
address@hidden accordingly.
+
+  If the text on a line starts with the Fortran continuation marker
address@hidden, 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
address@hidden, 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.
+
address@hidden ForIndent Num
address@hidden 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.)
+
address@hidden 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.
+
address@hidden 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
address@hidden to @code{nil}.
+
+
address@hidden ForIndent Conv
address@hidden 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:
+
address@hidden @bullet
address@hidden
+Two nested @samp{do} loops never share a @samp{continue} statement.
+
address@hidden
+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.
address@hidden itemize
+
address@hidden
+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.
+
address@hidden ForIndent Vars
address@hidden Variables for Fortran Indentation
+
address@hidden fortran-do-indent
address@hidden fortran-if-indent
address@hidden fortran-structure-indent
address@hidden fortran-continuation-indent
address@hidden address@hidden
address@hidden address@hidden
+  Several additional variables control how Fortran indentation works:
+
address@hidden @code
address@hidden fortran-do-indent
+Extra indentation within each level of @samp{do} statement (default 3).
+
address@hidden fortran-if-indent
+Extra indentation within each level of @samp{if}, @samp{select case}, or
address@hidden statements (default 3).
+
address@hidden fortran-structure-indent
+Extra indentation within each level of @samp{structure}, @samp{union},
address@hidden, or @samp{interface} statements (default 3).
+
address@hidden fortran-continuation-indent
+Extra indentation for bodies of continuation lines (default 5).
+
address@hidden 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
address@hidden statement for this purpose.  If this variable has a
address@hidden value, indenting any numbered statement must check for a
address@hidden 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
address@hidden  The default is @code{nil}.
+
address@hidden 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
address@hidden) statement to show where it is.  The default is @code{nil}.
+
address@hidden 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.
+
address@hidden 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.
address@hidden table
+
+The variables controlling the indentation of comments are described in
+the following section.
+
address@hidden Fortran Comments
address@hidden 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.
+
address@hidden 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
address@hidden to @samp{"!"}.
+
address@hidden @kbd
address@hidden M-;
+Align comment or insert new comment (@code{fortran-indent-comment}).
+
address@hidden C-x ;
+Applies to nonstandard @samp{!} comments only.
+
address@hidden C-c ;
+Turn all lines of the region into comments, or (with argument) turn them back
+into real code (@code{fortran-comment-region}).
address@hidden table
+
address@hidden fortran-indent-comment
+  @kbd{M-;} in Fortran mode is redefined as the command
address@hidden  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
address@hidden to one of these values:
+
address@hidden fortran-comment-indent-style
address@hidden fortran-comment-line-extra-indent
address@hidden @code
address@hidden fixed
+Align the text at a fixed column, which is the sum of
address@hidden and the minimum statement
+indentation.  This is the default.
+
+The minimum statement indentation is
address@hidden for fixed format
+continuation line style and @code{fortran-minimum-statement-indent-tab}
+for tab format style.
+
address@hidden relative
+Align the text as if it were a line of code, but with an additional
address@hidden columns of indentation.
+
address@hidden nil
+Don't move text in full-line comments automatically.
address@hidden table
+
address@hidden fortran-comment-indent-char
+  In addition, you can specify the character to be used to indent within
+full-line comments by setting the variable
address@hidden to the single-character string you want
+to use.
+
address@hidden 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
address@hidden  The variable
address@hidden 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.
+
address@hidden C-c ; @r{(Fortran mode)}
address@hidden fortran-comment-region
address@hidden 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.
+
address@hidden Fortran Autofill
address@hidden 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
address@hidden, @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}.
+
address@hidden 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
address@hidden, @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
address@hidden to @code{fortran-mode-hook}.  @xref{Hooks,,,
+emacs, the Emacs Manual}.
+
address@hidden Fortran Columns
address@hidden Checking Columns in Fortran
+
address@hidden @kbd
address@hidden C-c C-r
+Display a ``column ruler'' momentarily above the current line
+(@code{fortran-column-ruler}).
address@hidden 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.
address@hidden 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.
address@hidden M-x fortran-strip-sequence-nos
+Delete all text in column 72 and beyond.
address@hidden table
+
address@hidden C-c C-r @r{(Fortran mode)}
address@hidden 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.
+
address@hidden fortran-column-ruler-fixed
address@hidden 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
address@hidden, then the value of the variable
address@hidden 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.
+
address@hidden C-c C-w @r{(Fortran mode)}
address@hidden 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.
+
address@hidden C-u C-c C-w @r{(Fortran mode)}
address@hidden 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.
+
address@hidden 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.
+
address@hidden Fortran Abbrev
address@hidden 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.
address@hidden,,, 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
address@hidden  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 address@hidden
+
+  Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
+Fortran abbrevs and what they stand for.
 
 @node Index
 @unnumbered Index




reply via email to

[Prev in Thread] Current Thread [Next in Thread]