]> code.delx.au - gnu-emacs/blobdiff - man/programs.texi
(Basic Isearch): Add `isearch' index entry.
[gnu-emacs] / man / programs.texi
index 9ec4f7ff2d3adc901bd4ecf416f65763a33a4372..17aa9c9cb12009dc3a5a5399a5ec8648a9e71ca4 100644 (file)
@@ -42,6 +42,9 @@ Highlight program syntax (@pxref{Font Lock}).
 * C Modes::             Special commands of C, C++, Objective-C,
                           Java, and Pike modes.
 * Asm Mode::            Asm mode and its special features.
+@ifnottex
+* Fortran::             Fortran mode and its special features.
+@end ifnottex
 @end menu
 
 @node Program Modes
@@ -109,7 +112,14 @@ tab character before point, in these modes.
 Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK
 (@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes
 (@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}).  For Fortran
-mode, @inforef{Fortran,, emacs-xtra}.
+mode, see
+@iftex
+@ref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@ref{Fortran}.
+@end ifnottex
+
 
 @cindex mode hook
 @vindex c-mode-hook
@@ -360,7 +370,8 @@ usual conventions of the language you are editing.
 @item @key{TAB}
 Adjust indentation of current line.
 @item C-j
-Equivalent to @key{RET} followed by @key{TAB} (@code{newline-and-indent}).
+Insert a newline, then adjust indentation of following line
+(@code{newline-and-indent}).
 @end table
 
 @kindex TAB @r{(programming modes)}
@@ -385,9 +396,11 @@ the characters around it.
 @kindex C-j
 @findex newline-and-indent
   When entering lines of new code, use @kbd{C-j}
-(@code{newline-and-indent}), which is equivalent to @key{RET}
-followed by @key{TAB}.  @kbd{C-j} at the end of a line creates a
-blank line and then gives it the appropriate indentation.
+(@code{newline-and-indent}), which inserts a newline and then adjusts
+indentation after it.  (It also deletes any trailing whitespace which
+remains before the new newline.)  Thus, @kbd{C-j} at the end of a line
+creates a blank line with appropriate indentation.  In programming
+language modes, it is equivalent to @key{RET} @key{TAB}.
 
   @key{TAB} indents a line that starts within a parenthetical grouping
 under the preceding line within the grouping, or the text after the
@@ -851,7 +864,7 @@ also do spell checking on comments with Flyspell Prog mode
 (@pxref{Spelling}).
 
 @menu
-* Comment Commands::    Inserting, killing, and indenting comments.
+* Comment Commands::    Inserting, killing, and aligning comments.
 * Multi-Line Comments:: Commands for adding and editing multi-line comments.
 * Options for Comments::Customizing the comment features.
 @end menu
@@ -859,6 +872,7 @@ also do spell checking on comments with Flyspell Prog mode
 @node Comment Commands
 @subsection Comment Commands
 @cindex indentation for comments
+@cindex alignment for comments
 
   The comment commands in this table insert, kill and align comments.
 They are described in this section and following sections.
@@ -897,11 +911,11 @@ away.  If the major mode has specified a string to terminate comments,
 @kbd{M-;} inserts that after point, to keep the syntax valid.
 
   If the text of the line extends past the comment column, this
-command indents the comment start string to a suitable boundary
+command aligns the comment start string to a suitable boundary
 (usually, at least one space is inserted).
 
   You can also use @kbd{M-;} to align an existing comment.  If a line
-already contains the comment-start string, @kbd{M-;} reindents it to
+already contains the comment-start string, @kbd{M-;} realigns it to
 the conventional alignment and moves point after it.  (Exception:
 comments starting in column 0 are not moved.)  Even when an existing
 comment is properly aligned, @kbd{M-;} is still useful for moving
@@ -931,19 +945,20 @@ or else enable Transient Mark mode momentarily (@pxref{Momentary Mark}).
 A prefix argument used in these circumstances specifies how many
 comment delimiters to add or how many to delete.
 
-  Some major modes have special rules for indenting certain kinds of
+  Some major modes have special rules for aligning certain kinds of
 comments in certain contexts.  For example, in Lisp code, comments which
 start with two semicolons are indented as if they were lines of code,
 instead of at the comment column.  Comments which start with three
-semicolons are supposed to start at the left margin.  Emacs understands
+semicolons are supposed to start at the left margin and are often used
+for sectioning purposes.  Emacs understands
 these conventions by indenting a double-semicolon comment using @key{TAB},
 and by not changing the indentation of a triple-semicolon comment at all.
 
 @example
-;; This function is just an example
+;; This function is just an example.
 ;;; Here either two or three semicolons are appropriate.
 (defun foo (x)
-;;; And now, the first part of the function:
+;;;  And now, the first part of the function:
   ;; The following line adds one.
   (1+ x))           ; This line adds one.
 @end example
@@ -982,13 +997,13 @@ commenting them out.  With a negative argument, it does the
 opposite---it deletes comment delimiters from the lines in the region.
 
   With a positive argument, @code{comment-region} duplicates the last
-character of the comment start sequence it adds; the argument specifies
-how many copies of the character to insert.  Thus, in Lisp mode,
-@kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line.  Duplicating
-the comment delimiter is a way of calling attention to the comment.  It
-can also affect how the comment is indented.  In Lisp, for proper
-indentation, you should use an argument of two or three, if between defuns;
-if within a defun, it must be three.
+character of the comment start sequence it adds; the argument
+specifies how many copies of the character to insert.  Thus, in Lisp
+mode, @kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line.
+Duplicating the comment delimiter is a way of calling attention to the
+comment.  It can also affect how the comment is aligned or indented.
+In Lisp, for proper indentation, you should use an argument of two or
+three, if between defuns; if within a defun, it must be three.
 
   You can configure C Mode such that when you type a @samp{/} at the
 start of a line in a multi-line block comment, this closes the
@@ -1058,7 +1073,7 @@ The default for this variable depends on the major mode.
 
 @vindex comment-indent-function
   The variable @code{comment-indent-function} should contain a function
-that will be called to compute the indentation for a newly inserted
+that will be called to compute the alignment for a newly inserted
 comment or for aligning an existing comment.  It is set differently by
 various major modes.  The function is called with no arguments, but with
 point at the beginning of the comment, or at the end of a line if a new
@@ -1102,7 +1117,7 @@ You can also use @kbd{M-x info-lookup-file} to look for documentation
 for a file name.
 
   If you use @kbd{C-h S} in a major mode that does not support it,
-it asks you to specify the ``symbol help mode''.  You should enter
+it asks you to specify the ``symbol help mode.''  You should enter
 a command such as @code{c-mode} that would select a major
 mode which @kbd{C-h S} does support.
 
@@ -1587,7 +1602,7 @@ hungry-delete feature is enabled.
 @itemx M-x c-subword-mode
 @findex c-subword-mode
 Enable (or disable) @dfn{subword mode}.  In subword mode, Emacs's word
-commands then recognize upper case letters in
+commands recognize upper case letters in
 @samp{StudlyCapsIdentifiers} as word boundaries.  This is indicated by
 the flag @samp{/w} on the mode line after the mode name
 (e.g. @samp{C/law}).  You can even use @kbd{M-x c-subword-mode} in
@@ -1609,11 +1624,11 @@ needs a binding to be useful.  The following code will bind it to
 @kbd{C-j}.  We use @code{c-initialization-hook} here to make sure
 the keymap is loaded before we try to change it.
 
-@example
+@smallexample
 (defun my-bind-clb ()
   (define-key c-mode-base-map "\C-j" 'c-context-line-break))
 (add-hook 'c-initialization-hook 'my-bind-clb)
-@end example
+@end smallexample
 
 @item C-M-h
 Put mark at the end of a function definition, and put point at the
@@ -1738,6 +1753,10 @@ Insert or align a comment.
   The variable @code{asm-comment-char} specifies which character
 starts comments in assembler syntax.
 
+@ifnottex
+@include fortran-xtra.texi
+@end ifnottex
+
 @ignore
    arch-tag: c7ee7409-40a4-45c7-bfb7-ae7f2c74d0c0
 @end ignore