From 8ee98d74d870c73fa15fbd64ec6e608e82c18fb3 Mon Sep 17 00:00:00 2001 From: Warren Block Date: Fri, 5 Aug 2016 20:23:25 +0000 Subject: [PATCH] Update Emacs section of editor configuration chapter in FDP Primer. PR: 211184 Submitted by: Joseph Mingrone --- .../fdp-primer/editor-config/chapter.xml | 83 ++++++++++++++++++- 1 file changed, 79 insertions(+), 4 deletions(-) diff --git a/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml b/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml index 353e3c9827..4a2d716089 100644 --- a/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml +++ b/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml @@ -105,12 +105,87 @@ endfunction " Set_SGML() Install from editors/emacs - or editors/xemacs. + or editors/emacs-devel. - Edit ~/.emacs, adding this - line: + + Validation - (add-hook 'nxml-mode-hook 'turn-on-auto-fill) + 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 + ~/.emacs.d/schema/schemas.xml and add + these lines to the file: + + locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0" + documentElement localName="section" typeId="DocBook" + documentElement localName="chapter" typeId="DocBook" + documentElement localName="article" typeId="DocBook" + documentElement localName="book" typeId="DocBook" + typeId id="DocBook" uri="/usr/local/share/xml/docbook/5.0/rng/docbook.rnc" +locatingRules + + + + + Automated Proofreading with Flycheck and Igor + + The Flycheck package is available from Milkypostman's + Emacs Lisp Package Archive (MELPA). If + MELPA is not already in Emacs's + packages-archives, it can be added by evaluating + + (add-to-list 'package-archives '("melpa" . "http://stable.melpa.org/packages/") t) + + Add the line to Emacs's initialization file (one of + ~/.emacs, + ~/.emacs.el, or + ~.emacs.d/init.el) to make this change + permanent. + + To install Flycheck, evaluate + + (package-install 'flycheck) + + Create a Flycheck checker for + textproc/igor by evaluating + + (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) + + Again, add these lines to Emacs's initialization file to + make the changes permanent. + + + + FreeBSD Documentation Specific Settings + + To apply settings specific to the FreeBSD documentation + project, create .dir-locals.el in the + root directory of the documentation repository and add these + lines to the file: + + ;;; 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")))) +