aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-07-13 21:23:41 +0200
committerPeter Eisentraut <peter_e@gmx.net>2018-07-13 21:28:18 +0200
commitbc4e355f013d6122e4ae17fa99e9db20babbb86a (patch)
tree3a6214eccc457ed0e79fd99866a2deb6ea0a6d92 /src
parent9a5e8ed283e583782b3f40e6ededcb005d5c0333 (diff)
downloadpostgresql-bc4e355f013d6122e4ae17fa99e9db20babbb86a.tar.gz
postgresql-bc4e355f013d6122e4ae17fa99e9db20babbb86a.zip
Update documentation editor setup instructions
Now that the documentation sources are in XML rather than SGML, some of the documentation about the editor, or more specifically Emacs, setup needs updating. The updated instructions recommend using nxml-mode, which works mostly out of the box, with some small tweaks in emacs.samples and .dir-locals.el. Also remove some obsolete stuff in .dir-locals.el. I did, however, leave the sgml-mode settings in there so that someone using Emacs without emacs.samples gets those settings when editing a *.sgml file.
Diffstat (limited to 'src')
-rw-r--r--src/tools/editors/emacs.samples19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/tools/editors/emacs.samples b/src/tools/editors/emacs.samples
index 5f08c71dd18..a7152b04bc9 100644
--- a/src/tools/editors/emacs.samples
+++ b/src/tools/editors/emacs.samples
@@ -62,12 +62,23 @@
;;; documentation files
-(add-hook 'sgml-mode-hook
- (defun postgresql-sgml-mode-hook ()
+;; *.sgml files are actually XML
+(add-to-list 'auto-mode-alist '("/postgres\\(ql\\)?/.*\\.sgml\\'" . nxml-mode))
+
+(add-hook 'nxml-mode-hook
+ (defun postgresql-xml-mode-hook ()
(when (string-match "/postgres\\(ql\\)?/" buffer-file-name)
(setq fill-column 78)
- (setq indent-tabs-mode nil)
- (setq sgml-basic-offset 1))))
+ (setq indent-tabs-mode nil))))
+
+;; The *.xsl files use 2-space indent, which is consistent with
+;; docbook-xsl sources and also the nxml-mode default. But the *.sgml
+;; files use 1-space indent, mostly for historical reasons at this
+;; point.
+(add-hook 'nxml-mode-hook
+ (defun postgresql-xml-src-mode-hook ()
+ (when (string-match "/postgres\\(ql\\)?/.*\\.sgml\\'" buffer-file-name)
+ (setq nxml-child-indent 1))))
;;; Makefiles