/usr/share/doc/jed-common/html/jed012.html is in jed-common 1:0.99.19-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | <!DOCTYPE html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="generator" content="hevea 2.28">
<link rel="stylesheet" type="text/css" href="jed.css">
<title>Modes</title>
</head>
<body >
<a href="jed011.html"><img src="previous_motif.gif" alt="Previous"></a>
<a href="index.html"><img src="contents_motif.gif" alt="Up"></a>
<a href="jed013.html"><img src="next_motif.gif" alt="Next"></a>
<hr>
<h2 id="sec24" class="section">11  Modes</h2>
<p><span style="font-weight:bold">jed</span> supports two internal modes as well as user defined modes. The two
internal modes consist of a “C” mode for C Language programming and a
“Wrap” mode for ordinary text editing. Examples of user defined modes
are Fortran mode and DCL mode.</p><p>Online documentation is provided for nearly every mode <span style="font-weight:bold">jed</span> defines.
For help on the current mode, press <span style="font-variant:small-caps">Esc X</span> and enter
<code>describe_mode</code>. A window will appear with a short description of the
special features of the mode as well as a description of the variables
affecting the mode.</p>
<h3 id="sec25" class="subsection">11.1  Wrap Mode</h3>
<p>In this mode, text is wrapped at the column given by the <code>WRAP</code>
variable. The default is 78. The text does not wrap until the cursor goes
beyond the wrap column and a space is inserted.</p>
<h4 id="sec26" class="subsubsection">11.1.1  Formatting paragraphs</h4>
<p>Paragraph delimiters are: blank lines, lines that begin with either a
percent character, <span style="font-family:monospace">%</span>, or a backslash character <code>\</code>. This
definition is ideally suited for editing L<sup>A</sup>T<sub>E</sub>X documents. However, it
is possible for the user to change this definition. See the discussion of
the hook, <code>is_paragraph_separator</code>, in the section on hooks for
explicit details on how to do this.</p><p>The paragraph is formatted according to the indentation of the current
line. If the current line is indented, the paragraph will be given the
same indentation. The default binding for this function is <span style="font-variant:small-caps">Esc q</span>.</p><p>In addition, a paragraph may be “narrowed” by the
<code>narrow_paragraph</code> function which is bound to <span style="font-variant:small-caps">Esc N</span> by default.
This differs from the ordinary <code>format_paragraph</code> function described
above in that the right margin is reduced by an amount equal to the
indentation of the current line. For example:
</p><pre class="verbatim"> This paragraph is the result of using the
function ``narrow_paragraph''. Note how the
right margin is less here than in the above
paragraph.
</pre><p>Finally, if either of these functions is called from the keyboard with a
prefix argument, the paragraph will be justified as well. For example,
pressing <span style="font-variant:small-caps">Esc 1 Esc N</span> on the previous paragraph yields:
</p><pre class="verbatim"> This paragraph is the result of using the
function ``narrow_paragraph''. Note how the
right margin is less here than in the above
paragraph.
</pre><p>See the discussion of <code>format_paragraph_hook</code> in the section on hooks
for details on how this is implemented.</p>
<h3 id="sec27" class="subsection">11.2  Smart Quotes</h3>
<p>You have probably noticed that many key words in this document are quoted
in double quotes like “this is double quoted” and ‘this is single
quoted’. By default, the double quote key (") and single quote key (’) are
bound to the function <code>text_smart_quote</code>. With this binding and in
wrap mode, the single quote key inserts a single quote with the “proper”
orientation and the double quote key inserts two single quotes of the
“proper” direction. To turn this off, rebind the keys to
<code>self_insert_cmd</code>. Some modes already do this (e.g., EDT).</p><p>This brings up the question: if the double quote key is bound to
<code>text_smart_quote</code> then how does one insert the character (")? The
most common way is to use the <code>quoted_insert</code> function which, by
default, is bound to the single backquote (<span style="font-variant:small-caps">‘</span>) key. This is the same
mechanism that is used to insert control characters. The other method is
to use the fact that if the preceding character is a backslash, <code>\</code>,
the character simply self inserts. Again, this is ideal for writing
T<sub>E</sub>X documents.</p>
<h3 id="sec28" class="subsection">11.3  C Mode</h3>
<p>C Mode facilitates the editing of C files. Much of the latter part of the
development of the <span style="font-weight:bold">jed</span> editor was done using this mode. This mode may be
customized by a judicious choice of the variables <code>C_INDENT</code> and
<code>C_BRACE</code> as well as the bindings of the curly brace keys <span style="font-family:monospace">{</span>
and <span style="font-variant:small-caps">}</span>. Experiment to find what you like or write your own using the
<span style="font-weight:bold">S-Lang</span> interface.</p><p>By default, the <span style="font-variant:small-caps">Enter</span> key is bound to the function
<code>newline_and_indent</code>. This does what its name suggests: inserts a
newline and indents. Again, some modes may rebind this key. In addition,
the keys <span style="font-family:monospace">{</span>, <span style="font-family:monospace">}</span>, and <span style="font-variant:small-caps">Tab</span> are also special in this mode.
The <span style="font-variant:small-caps">Tab</span> key indents the current line and the <span style="font-family:monospace">{</span> and <span style="font-family:monospace">}</span>
keys insert themselves and reindent. If you do not like any of these
bindings, simply rebind the offending one to <code>self_insert_cmd</code>.</p><p>Finally, the key sequence <span style="font-variant:small-caps">Esc ;</span> is bound to a function called
<code>c_make_comment</code>. This function makes and indents a C comment to the
column specified by the value of the variable <code>C_Comment_Column</code>. If
a comment is already present on the line, it is indented.</p>
<h3 id="sec29" class="subsection">11.4  Fortran Mode</h3>
<p>Fortran Mode is written entirely in <span style="font-weight:bold">S-Lang</span> and is designed to facilitate
the writing of Fortran programs. It features automatic indentation of
Fortran code as well as automatic placement of Fortran statement Labels.</p><p>In this mode, the keys <span style="font-variant:small-caps">0</span>-<span style="font-variant:small-caps">9</span> are bound to a function
<code>for_elebel</code> which does the following:
</p><ol class="enumerate" type=1><li class="li-enumerate">
Inserts the calling character (0-9) into the buffer.</li><li class="li-enumerate">If the character is preceded by only other digit characters, it
assumes the character is for a label and moves it to the appropriate
position.</li><li class="li-enumerate">Reindents the line.
</li></ol><p>This function is very similar to the one Emacs uses for labels.</p>
<hr>
<a href="jed011.html"><img src="previous_motif.gif" alt="Previous"></a>
<a href="index.html"><img src="contents_motif.gif" alt="Up"></a>
<a href="jed013.html"><img src="next_motif.gif" alt="Next"></a>
</body>
</html>
|