Lines 48-54
Link Here
|
48 |
<sect2 xml:id="editor-config-vim-use"> |
48 |
<sect2 xml:id="editor-config-vim-use"> |
49 |
<title>Use</title> |
49 |
<title>Use</title> |
50 |
|
50 |
|
51 |
<para>Press <keycap>P</keycap> to reformat paragraphs or text that has been selected in Visual mode. Press |
51 |
<para>Press <keycap>P</keycap> to reformat paragraphs or text |
|
|
52 |
that has been selected in Visual mode. Press |
52 |
<keycap>T</keycap> to replace groups of eight spaces with a |
53 |
<keycap>T</keycap> to replace groups of eight spaces with a |
53 |
tab.</para> |
54 |
tab.</para> |
54 |
</sect2> |
55 |
</sect2> |
Lines 103-116
Link Here
|
103 |
<sect1 xml:id="editor-config-emacs"> |
104 |
<sect1 xml:id="editor-config-emacs"> |
104 |
<title><application>Emacs</application></title> |
105 |
<title><application>Emacs</application></title> |
105 |
|
106 |
|
106 |
<para>Install from |
107 |
<para>Install from <package>editors/emacs</package> or |
107 |
<package>editors/emacs</package> |
108 |
<package>editors/emacs-devel</package>.</para> |
108 |
or <package>editors/xemacs</package>.</para> |
|
|
109 |
|
109 |
|
110 |
<para>Edit <filename>~/.emacs</filename>, adding this |
110 |
<sect2 xml:id="editor-config-emacs-validation"> |
111 |
line:</para> |
111 |
<title>Validation</title> |
112 |
|
112 |
|
113 |
<programlisting>(add-hook 'nxml-mode-hook 'turn-on-auto-fill)</programlisting> |
113 |
<para>Emacs's nxml-mode uses compact relax NG schemas for |
|
|
114 |
validating XML. A compact relax NG schema for FreeBSD's |
115 |
extension to DocBook 5.0 is included in the documentation |
116 |
repository. To configure nxml-mode to validate using this |
117 |
schema, create |
118 |
<filename>~/.emacs.d/schema/schemas.xml</filename> and these |
119 |
lines to the file:</para> |
120 |
|
121 |
<programlisting><tag class="starttag">locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"</tag> |
122 |
<tag class="starttag">documentElement localName="section" typeId="DocBook"</tag> |
123 |
<tag class="starttag">documentElement localName="chapter" typeId="DocBook"</tag> |
124 |
<tag class="starttag">documentElement localName="article" typeId="DocBook"</tag> |
125 |
<tag class="starttag">documentElement localName="book" typeId="DocBook"</tag> |
126 |
<tag class="starttag">typeId id="DocBook" uri="/usr/local/share/xml/docbook/5.0/rng/docbook.rnc"</tag> |
127 |
<tag class="endtag">locatingRules</tag></programlisting> |
128 |
|
129 |
</sect2> |
130 |
|
131 |
<sect2 xml:id="editor-config-emacs-igor"> |
132 |
<title>Automated Proofreading with Flycheck and Igor</title> |
133 |
|
134 |
<para>The Flycheck package is available from Milkypostman's |
135 |
Emacs Lisp Package Archive (<acronym>MELPA</acronym>). If |
136 |
<acronym>MELPA</acronym> is not already in Emacs's |
137 |
packages-archives, it can be added by evaluating</para> |
138 |
|
139 |
<programlisting>(add-to-list 'package-archives '("melpa" . "http://stable.melpa.org/packages/") t)</programlisting> |
140 |
|
141 |
<para>Add the line to Emacs's initialization file (one of |
142 |
<filename>~/.emacs</filename>, |
143 |
<filename>~/.emacs.el</filename>, or |
144 |
<filename>~.emacs.d/init.el</filename>) to make this change |
145 |
permanent.</para> |
146 |
|
147 |
<para>To install Flycheck, evaluate</para> |
148 |
|
149 |
<programlisting>(package-install 'flycheck)</programlisting> |
150 |
|
151 |
<para>Create a Flycheck checker for |
152 |
<package>textproc/igor</package> by evaluating</para> |
153 |
|
154 |
<programlisting>(flycheck-define-checker igor |
155 |
"FreeBSD Documentation Project sanity checker. |
156 |
|
157 |
See URLs http://www.freebsd.org/docproj/ and |
158 |
http://www.freshports.org/textproc/igor/." |
159 |
:command ("igor" "-X" source-inplace) |
160 |
:error-parser flycheck-parse-checkstyle |
161 |
:modes (nxml-mode) |
162 |
:standard-input t) |
163 |
|
164 |
(add-to-list 'flycheck-checkers 'igor 'append)</programlisting> |
165 |
|
166 |
<para>Again, add these lines to Emacs's initialization file to |
167 |
make the changes permanent.</para> |
168 |
</sect2> |
169 |
|
170 |
<sect2 xml:id="editor-config-emacs-specifc"> |
171 |
<title>FreeBSD Documentation Specific Settings</title> |
172 |
|
173 |
<para>To apply settings specific to the FreeBSD documentation |
174 |
project, create <filename>.dir-locals.el</filename> in the |
175 |
root directory of the documentation repository and add these |
176 |
lines to the file:</para> |
177 |
|
178 |
<programlisting>;;; Directory Local Variables |
179 |
;;; For more information see (info "(emacs) Directory Variables") |
180 |
|
181 |
((nxml-mode |
182 |
(eval . (turn-on-auto-fill)) |
183 |
(fill-column . 70) |
184 |
(eval . (require 'flycheck)) |
185 |
(eval . (flycheck-mode 1)) |
186 |
(flycheck-checker . igor) |
187 |
(eval . (add-to-list 'rng-schema-locating-files "~/.emacs.d/schema/schemas.xml"))))</programlisting> |
188 |
</sect2> |
114 |
</sect1> |
189 |
</sect1> |
115 |
|
190 |
|
116 |
<sect1 xml:id="editor-config-nano"> |
191 |
<sect1 xml:id="editor-config-nano"> |