Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Aug 2016 20:23:26 +0000 (UTC)
From:      Warren Block <wblock@FreeBSD.org>
To:        doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org
Subject:   svn commit: r49219 - head/en_US.ISO8859-1/books/fdp-primer/editor-config
Message-ID:  <201608052023.u75KNQqZ031760@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wblock
Date: Fri Aug  5 20:23:25 2016
New Revision: 49219
URL: https://svnweb.freebsd.org/changeset/doc/49219

Log:
  Update Emacs section of editor configuration chapter in FDP Primer.
  
  PR:		211184
  Submitted by:	Joseph Mingrone <jrm@ftfl.ca>

Modified:
  head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml

Modified: head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml	Fri Aug  5 18:51:24 2016	(r49218)
+++ head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml	Fri Aug  5 20:23:25 2016	(r49219)
@@ -105,12 +105,87 @@ endfunction " Set_SGML()</programlisting
 
     <para>Install from
       <package>editors/emacs</package>
-      or <package>editors/xemacs</package>.</para>
+      or <package>editors/emacs-devel</package>.</para>
 
-    <para>Edit <filename>~/.emacs</filename>, adding this
-      line:</para>
+    <sect2 xml:id="editor-config-emacs-validation">
+      <title>Validation</title>
 
-    <programlisting>(add-hook 'nxml-mode-hook 'turn-on-auto-fill)</programlisting>
+      <para>Emacs's nxml-mode uses compact relax NG schemas for
+	validating XML.  A compact relax NG schema for FreeBSD's
+	extension to DocBook 5.0 is included in the documentation
+	repository.  To configure nxml-mode to validate using this
+	schema, create
+	<filename>~/.emacs.d/schema/schemas.xml</filename> and add
+	these lines to the file:</para>
+
+      <programlisting><tag class="starttag">locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"</tag>;
+  <tag class="starttag">documentElement localName="section" typeId="DocBook"</tag>
+  <tag class="starttag">documentElement localName="chapter" typeId="DocBook"</tag>
+  <tag class="starttag">documentElement localName="article" typeId="DocBook"</tag>
+  <tag class="starttag">documentElement localName="book" typeId="DocBook"</tag>
+  <tag class="starttag">typeId id="DocBook" uri="/usr/local/share/xml/docbook/5.0/rng/docbook.rnc"</tag>
+<tag class="endtag">locatingRules</tag></programlisting>
+
+    </sect2>
+
+    <sect2 xml:id="editor-config-emacs-igor">
+      <title>Automated Proofreading with Flycheck and Igor</title>
+
+      <para>The Flycheck package is available from Milkypostman's
+	Emacs Lisp Package Archive (<acronym>MELPA</acronym>).  If
+	<acronym>MELPA</acronym> is not already in Emacs's
+	packages-archives, it can be added by evaluating</para>
+
+      <programlisting>(add-to-list 'package-archives '("melpa" . "http://stable.melpa.org/packages/") t)</programlisting>
+
+      <para>Add the line to Emacs's initialization file (one of
+	<filename>~/.emacs</filename>,
+	<filename>~/.emacs.el</filename>, or
+	<filename>~.emacs.d/init.el</filename>) to make this change
+	permanent.</para>
+
+      <para>To install Flycheck, evaluate</para>
+
+      <programlisting>(package-install 'flycheck)</programlisting>
+
+      <para>Create a Flycheck checker for
+	<package>textproc/igor</package> by evaluating</para>
+
+      <programlisting>(flycheck-define-checker igor
+  "FreeBSD Documentation Project sanity checker.
+
+See URLs http://www.freebsd.org/docproj/ and
+http://www.freshports.org/textproc/igor/."
+  :command ("igor" "-X" source-inplace)
+  :error-parser flycheck-parse-checkstyle
+  :modes (nxml-mode)
+  :standard-input t)
+
+  (add-to-list 'flycheck-checkers 'igor 'append)</programlisting>
+
+      <para>Again, add these lines to Emacs's initialization file to
+	make the changes permanent.</para>
+    </sect2>
+
+    <sect2 xml:id="editor-config-emacs-specifc">
+      <title>FreeBSD Documentation Specific Settings</title>
+
+      <para>To apply settings specific to the FreeBSD documentation
+	project, create <filename>.dir-locals.el</filename> in the
+	root directory of the documentation repository and add these
+	lines to the file:</para>
+
+      <programlisting>;;; Directory Local Variables
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nxml-mode
+  (eval . (turn-on-auto-fill))
+  (fill-column . 70)
+  (eval . (require 'flycheck))
+  (eval . (flycheck-mode 1))
+  (flycheck-checker . igor)
+  (eval . (add-to-list 'rng-schema-locating-files "~/.emacs.d/schema/schemas.xml"))))</programlisting>
+    </sect2>
   </sect1>
 
   <sect1 xml:id="editor-config-nano">



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608052023.u75KNQqZ031760>